Skip to content

Commit 2eee71e

Browse files
committed
Tune lints for 1.78 Rust
1 parent 6e3d738 commit 2eee71e

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

src/combinator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ where
4747
/// non-`escapable` `Input` or end of line.
4848
///
4949
/// [`escaped()`]: nom::bytes::complete::escaped()
50-
pub(crate) fn escaped0<'a, Input: 'a, Error, F, G, O1, O2>(
50+
pub(crate) fn escaped0<'a, Input, Error, F, G, O1, O2>(
5151
mut normal: F,
5252
control_char: char,
5353
mut escapable: G,
@@ -59,7 +59,8 @@ where
5959
+ InputTake
6060
+ InputTakeAtPosition
6161
+ Slice<RangeFrom<usize>>
62-
+ InputIter,
62+
+ InputIter
63+
+ 'a,
6364
<Input as InputIter>::Item: AsChar,
6465
F: Parser<Input, O1, Error>,
6566
G: Parser<Input, O2, Error>,

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
clippy::large_stack_frames,
6666
clippy::let_underscore_untyped,
6767
clippy::lossy_float_literal,
68+
clippy::manual_c_str_literals,
6869
clippy::manual_clamp,
6970
clippy::map_err_ignore,
7071
clippy::mem_forget,
@@ -88,6 +89,7 @@
8889
clippy::print_stderr,
8990
clippy::print_stdout,
9091
clippy::pub_without_shorthand,
92+
clippy::ref_as_ptr,
9193
clippy::rc_buffer,
9294
clippy::rc_mutex,
9395
clippy::read_zero_byte_vec,

src/parse.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub const RESERVED_CHARS: &str = r"{}()\/ ";
6262
/// [`EscapedEndOfLine`]: Error::EscapedEndOfLine
6363
/// [`EscapedNonReservedCharacter`]: Error::EscapedNonReservedCharacter
6464
/// [`Failure`]: Err::Failure
65-
fn escaped_reserved_chars0<'a, Input: 'a, F, O1>(
65+
fn escaped_reserved_chars0<'a, Input, F, O1>(
6666
normal: F,
6767
) -> impl FnMut(Input) -> IResult<Input, Input, Error<Input>>
6868
where
@@ -73,7 +73,8 @@ where
7373
+ InputTake
7474
+ InputTakeAtPosition
7575
+ Slice<RangeFrom<usize>>
76-
+ InputIter,
76+
+ InputIter
77+
+ 'a,
7778
<Input as InputIter>::Item: AsChar + Copy,
7879
F: Parser<Input, O1, Error<Input>>,
7980
Error<Input>: ParseError<Input>,
@@ -146,7 +147,7 @@ where
146147
/// [`UnescapedReservedCharacter`]: Error::UnescapedReservedCharacter
147148
/// [`UnfinishedParameter`]: Error::UnfinishedParameter
148149
/// [0]: crate#grammar
149-
pub fn parameter<'a, Input: 'a>(
150+
pub fn parameter<'a, Input>(
150151
input: Input,
151152
indexer: &mut usize,
152153
) -> IResult<Input, Parameter<Input>, Error<Input>>
@@ -159,7 +160,8 @@ where
159160
+ InputTakeAtPosition<Item = char>
160161
+ Slice<RangeFrom<usize>>
161162
+ InputIter
162-
+ for<'s> Compare<&'s str>,
163+
+ for<'s> Compare<&'s str>
164+
+ 'a,
163165
<Input as InputIter>::Item: AsChar + Copy,
164166
Error<Input>: ParseError<Input>,
165167
for<'s> &'s str: FindToken<<Input as InputIter>::Item>,
@@ -269,7 +271,7 @@ where
269271
/// [`UnescapedReservedCharacter`]: Error::UnescapedReservedCharacter
270272
/// [`UnfinishedOptional`]: Error::UnfinishedOptional
271273
/// [0]: crate#grammar
272-
pub fn optional<'a, Input: 'a>(
274+
pub fn optional<'a, Input>(
273275
input: Input,
274276
) -> IResult<Input, Optional<Input>, Error<Input>>
275277
where
@@ -281,7 +283,8 @@ where
281283
+ InputTakeAtPosition<Item = char>
282284
+ Slice<RangeFrom<usize>>
283285
+ InputIter
284-
+ for<'s> Compare<&'s str>,
286+
+ for<'s> Compare<&'s str>
287+
+ 'a,
285288
<Input as InputIter>::Item: AsChar + Copy,
286289
Error<Input>: ParseError<Input>,
287290
for<'s> &'s str: FindToken<<Input as InputIter>::Item>,
@@ -375,7 +378,7 @@ where
375378
///
376379
/// [`Failure`]: Err::Failure
377380
/// [0]: crate#grammar
378-
pub fn alternative<'a, Input: 'a>(
381+
pub fn alternative<'a, Input>(
379382
input: Input,
380383
) -> IResult<Input, Alternative<Input>, Error<Input>>
381384
where
@@ -387,7 +390,8 @@ where
387390
+ InputTakeAtPosition<Item = char>
388391
+ Slice<RangeFrom<usize>>
389392
+ InputIter
390-
+ for<'s> Compare<&'s str>,
393+
+ for<'s> Compare<&'s str>
394+
+ 'a,
391395
<Input as InputIter>::Item: AsChar + Copy,
392396
Error<Input>: ParseError<Input>,
393397
for<'s> &'s str: FindToken<<Input as InputIter>::Item>,
@@ -529,7 +533,7 @@ where
529533
///
530534
/// [`Failure`]: Err::Failure
531535
/// [0]: crate#grammar
532-
pub fn single_expression<'a, Input: 'a>(
536+
pub fn single_expression<'a, Input>(
533537
input: Input,
534538
indexer: &mut usize,
535539
) -> IResult<Input, SingleExpression<Input>, Error<Input>>
@@ -542,7 +546,8 @@ where
542546
+ InputTakeAtPosition<Item = char>
543547
+ Slice<RangeFrom<usize>>
544548
+ InputIter
545-
+ for<'s> Compare<&'s str>,
549+
+ for<'s> Compare<&'s str>
550+
+ 'a,
546551
<Input as InputIter>::Item: AsChar + Copy,
547552
Error<Input>: ParseError<Input>,
548553
for<'s> &'s str: FindToken<<Input as InputIter>::Item>,
@@ -592,7 +597,7 @@ where
592597
///
593598
/// [`Failure`]: Err::Failure
594599
/// [0]: crate#grammar
595-
pub fn expression<'a, Input: 'a>(
600+
pub fn expression<'a, Input>(
596601
input: Input,
597602
) -> IResult<Input, Expression<Input>, Error<Input>>
598603
where
@@ -604,7 +609,8 @@ where
604609
+ InputTakeAtPosition<Item = char>
605610
+ Slice<RangeFrom<usize>>
606611
+ InputIter
607-
+ for<'s> Compare<&'s str>,
612+
+ for<'s> Compare<&'s str>
613+
+ 'a,
608614
<Input as InputIter>::Item: AsChar + Copy,
609615
Error<Input>: ParseError<Input>,
610616
for<'s> &'s str: FindToken<<Input as InputIter>::Item>,

0 commit comments

Comments
 (0)