Skip to content

Commit d22b143

Browse files
committed
Tune lints for 1.58 Rust
1 parent 4148c77 commit d22b143

File tree

4 files changed

+85
-5
lines changed

4 files changed

+85
-5
lines changed

src/expand/mod.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ mod spec {
590590

591591
#[test]
592592
fn alternation_with_optional() {
593+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
593594
let expr = Expression::regex("a/b(c)")
594595
.unwrap_or_else(|e| panic!("failed: {}", e));
595596

@@ -598,6 +599,7 @@ mod spec {
598599

599600
#[test]
600601
fn alternation() {
602+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
601603
let expr = Expression::regex("a/b c/d/e")
602604
.unwrap_or_else(|e| panic!("failed: {}", e));
603605

@@ -611,6 +613,7 @@ mod spec {
611613

612614
#[test]
613615
fn empty() {
616+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
614617
let expr =
615618
Expression::regex("").unwrap_or_else(|e| panic!("failed: {}", e));
616619

@@ -621,6 +624,7 @@ mod spec {
621624

622625
#[test]
623626
fn escape_regex_characters() {
627+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
624628
let expr = Expression::regex(r"^$[]\()\{}\\.|?*+")
625629
.unwrap_or_else(|e| panic!("failed: {}", e));
626630

@@ -630,6 +634,7 @@ mod spec {
630634

631635
#[test]
632636
fn optional() {
637+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
633638
let expr = Expression::regex("(a)")
634639
.unwrap_or_else(|e| panic!("failed: {}", e));
635640

@@ -641,6 +646,7 @@ mod spec {
641646

642647
#[test]
643648
fn parameter_int() {
649+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
644650
let expr = Expression::regex("{int}")
645651
.unwrap_or_else(|e| panic!("failed: {}", e));
646652

@@ -653,6 +659,7 @@ mod spec {
653659

654660
#[test]
655661
fn parameter_float() {
662+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
656663
let expr = Expression::regex("{float}")
657664
.unwrap_or_else(|e| panic!("failed: {}", e));
658665

@@ -674,6 +681,7 @@ mod spec {
674681

675682
#[test]
676683
fn parameter_word() {
684+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
677685
let expr = Expression::regex("{word}")
678686
.unwrap_or_else(|e| panic!("failed: {}", e));
679687

@@ -685,6 +693,7 @@ mod spec {
685693

686694
#[test]
687695
fn parameter_string() {
696+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
688697
let expr = Expression::regex("{string}")
689698
.unwrap_or_else(|e| panic!("failed: {}", e));
690699

@@ -703,6 +712,7 @@ mod spec {
703712

704713
#[test]
705714
fn parameter_all() {
715+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
706716
let expr =
707717
Expression::regex("{}").unwrap_or_else(|e| panic!("failed: {}", e));
708718

@@ -712,6 +722,7 @@ mod spec {
712722

713723
#[test]
714724
fn text() {
725+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
715726
let expr =
716727
Expression::regex("a").unwrap_or_else(|e| panic!("failed: {}", e));
717728

@@ -721,9 +732,9 @@ mod spec {
721732
assert!(!expr.is_match("ab"));
722733
}
723734

724-
#[allow(clippy::non_ascii_literal)]
725735
#[test]
726736
fn unicode() {
737+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
727738
let expr = Expression::regex("Привет, Мир(ы)!")
728739
.unwrap_or_else(|e| panic!("failed: {}", e));
729740

@@ -740,6 +751,7 @@ mod spec {
740751
assert_eq!(*not_found, "custom");
741752
}
742753
e @ (Error::Parsing(_) | Error::Regex(_)) => {
754+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
743755
panic!("wrong err: {}", e);
744756
}
745757
}

src/expand/parameters.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ mod spec {
233233
#[test]
234234
fn custom_parameter() {
235235
let pars = HashMap::from([("custom", "custom")]);
236+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
236237
let expr = Expression::regex_with_parameters("{custom}", &pars)
237238
.unwrap_or_else(|e| panic!("failed: {}", e));
238239

@@ -242,6 +243,7 @@ mod spec {
242243
#[test]
243244
fn default_parameter() {
244245
let pars = HashMap::from([("custom", "custom")]);
246+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
245247
let expr = Expression::regex_with_parameters("{}", &pars)
246248
.unwrap_or_else(|e| panic!("failed: {}", e));
247249

@@ -258,6 +260,7 @@ mod spec {
258260
assert_eq!(*not_found, "custom");
259261
}
260262
e @ (Error::Regex(_) | Error::Parsing(_)) => {
263+
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
261264
panic!("wrong err: {}", e)
262265
}
263266
}

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
clippy::filetype_is_file,
4141
clippy::float_cmp_const,
4242
clippy::fn_to_numeric_cast,
43+
clippy::fn_to_numeric_cast_any,
4344
clippy::get_unwrap,
4445
clippy::if_then_some_else_none,
4546
clippy::imprecise_flops,
@@ -65,11 +66,14 @@
6566
clippy::str_to_string,
6667
clippy::string_add,
6768
clippy::string_lit_as_bytes,
69+
clippy::string_slice,
6870
clippy::string_to_string,
6971
clippy::suboptimal_flops,
7072
clippy::suspicious_operation_groupings,
7173
clippy::todo,
74+
clippy::trailing_empty_array,
7275
clippy::trivial_regex,
76+
clippy::undocumented_unsafe_blocks,
7377
clippy::unimplemented,
7478
clippy::unnecessary_self_imports,
7579
clippy::unneeded_field_pattern,

0 commit comments

Comments
 (0)