Skip to content

Commit 72755ec

Browse files
committed
Tune lints for 1.57 Rust
1 parent 2f57e40 commit 72755ec

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
###########
5555

5656
feature:
57-
name: Feature
5857
if: ${{ github.ref == 'refs/heads/main'
5958
|| startsWith(github.ref, 'refs/tags/v')
6059
|| !contains(github.event.head_commit.message, '[skip ci]') }}

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
clippy::decimal_literal_representation,
3434
clippy::else_if_without_else,
3535
clippy::empty_line_after_outer_attr,
36+
clippy::equatable_if_let,
3637
clippy::exit,
3738
clippy::expect_used,
3839
clippy::fallible_impl_from,
@@ -59,6 +60,7 @@
5960
clippy::rc_buffer,
6061
clippy::rc_mutex,
6162
clippy::rest_pat_in_fully_bound_structs,
63+
clippy::same_name_method,
6264
clippy::shadow_unrelated,
6365
clippy::str_to_string,
6466
clippy::string_add,

src/parse.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,35 +160,35 @@ where
160160
{
161161
let is_name = |c| !"{}(\\/".contains(c);
162162

163-
let fail = |input: Input, opening_brace| {
164-
match input.iter_elements().next().map(AsChar::as_char) {
163+
let fail = |inp: Input, opening_brace| {
164+
match inp.iter_elements().next().map(AsChar::as_char) {
165165
Some('{') => {
166166
if let Ok((_, (par, ..))) = peek(tuple((
167167
parameter,
168168
escaped_reserved_chars0(take_while(is_name)),
169169
tag("}"),
170-
)))(input.clone())
170+
)))(inp.clone())
171171
{
172172
return Error::NestedParameter(
173-
input.take(par.0.input_len() + 2),
173+
inp.take(par.0.input_len() + 2),
174174
)
175175
.failure();
176176
}
177-
return Error::UnescapedReservedCharacter(input.take(1))
177+
return Error::UnescapedReservedCharacter(inp.take(1))
178178
.failure();
179179
}
180180
Some('(') => {
181-
if let Ok((_, opt)) = peek(optional)(input.clone()) {
181+
if let Ok((_, opt)) = peek(optional)(inp.clone()) {
182182
return Error::OptionalInParameter(
183-
input.take(opt.0.input_len() + 2),
183+
inp.take(opt.0.input_len() + 2),
184184
)
185185
.failure();
186186
}
187-
return Error::UnescapedReservedCharacter(input.take(1))
187+
return Error::UnescapedReservedCharacter(inp.take(1))
188188
.failure();
189189
}
190190
Some(c) if RESERVED_CHARS.contains(c) => {
191-
return Error::UnescapedReservedCharacter(input.take(1))
191+
return Error::UnescapedReservedCharacter(inp.take(1))
192192
.failure();
193193
}
194194
_ => {}
@@ -273,38 +273,38 @@ where
273273
{
274274
let is_in_optional = |c| !"(){\\/".contains(c);
275275

276-
let fail = |input: Input, opening_brace| {
277-
match input.iter_elements().next().map(AsChar::as_char) {
276+
let fail = |inp: Input, opening_brace| {
277+
match inp.iter_elements().next().map(AsChar::as_char) {
278278
Some('(') => {
279279
if let Ok((_, (opt, ..))) = peek(tuple((
280280
optional,
281281
escaped_reserved_chars0(take_while(is_in_optional)),
282282
tag(")"),
283-
)))(input.clone())
283+
)))(inp.clone())
284284
{
285285
return Error::NestedOptional(
286-
input.take(opt.0.input_len() + 2),
286+
inp.take(opt.0.input_len() + 2),
287287
)
288288
.failure();
289289
}
290-
return Error::UnescapedReservedCharacter(input.take(1))
290+
return Error::UnescapedReservedCharacter(inp.take(1))
291291
.failure();
292292
}
293293
Some('{') => {
294-
if let Ok((_, par)) = peek(parameter)(input.clone()) {
294+
if let Ok((_, par)) = peek(parameter)(inp.clone()) {
295295
return Error::ParameterInOptional(
296-
input.take(par.0.input_len() + 2),
296+
inp.take(par.0.input_len() + 2),
297297
)
298298
.failure();
299299
}
300-
return Error::UnescapedReservedCharacter(input.take(1))
300+
return Error::UnescapedReservedCharacter(inp.take(1))
301301
.failure();
302302
}
303303
Some('/') => {
304-
return Error::AlternationInOptional(input.take(1)).failure();
304+
return Error::AlternationInOptional(inp.take(1)).failure();
305305
}
306306
Some(c) if RESERVED_CHARS.contains(c) => {
307-
return Error::UnescapedReservedCharacter(input.take(1))
307+
return Error::UnescapedReservedCharacter(inp.take(1))
308308
.failure();
309309
}
310310
_ => {}

0 commit comments

Comments
 (0)