Skip to content

Commit

Permalink
fix clippy lints in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 committed Feb 17, 2022
1 parent f386310 commit b438893
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions strum_tests/tests/enum_discriminants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ fn from_test() {

#[test]
fn from_ref_test() {
assert_eq!(EnumIntoDiscriminants::A, (&EnumInto::A(true)).into());
assert_eq!(EnumIntoDiscriminants::B, (&EnumInto::B(1)).into());
assert_eq!(EnumIntoDiscriminants::A, (EnumInto::A(true)).into());
assert_eq!(EnumIntoDiscriminants::B, (EnumInto::B(1)).into());
}

#[derive(Debug)]
Expand All @@ -201,7 +201,7 @@ fn from_test_complex() {
#[test]
fn from_ref_test_complex() {
let rara = Rara;
assert_eq!(EnumIntoComplexVars::A, (&EnumIntoComplex::A(&rara)).into());
assert_eq!(EnumIntoComplexVars::A, (EnumIntoComplex::A(&rara)).into());
}

#[allow(dead_code)]
Expand Down
24 changes: 12 additions & 12 deletions strum_tests/tests/enum_variant_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ fn non_plain_camel() {

#[test]
fn clap_and_structopt() {
#[derive(Debug, StructOpt)]
#[allow(unused)]
struct StructOptExample {
/// The main color
#[structopt(
long = "color",
default_value = "Color::Blue",
raw(possible_values = "Color::VARIANTS")
)]
color: Color,
}

#[derive(Debug, EnumString, EnumVariantNames)]
#[strum(serialize_all = "kebab_case")]
enum Color {
Expand All @@ -91,18 +103,6 @@ fn clap_and_structopt() {
.possible_values(Color::VARIANTS)
.case_insensitive(true),
);

#[derive(Debug, StructOpt)]
#[allow(unused)]
struct StructOptExample {
/// The main color
#[structopt(
long = "color",
default_value = "Color::Blue",
raw(possible_values = "Color::VARIANTS")
)]
color: Color,
}
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion strum_tests/tests/serialize_all.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// test serialize_all cooperation with other macroses
/// test `serialize_all` cooperation with other macroses
use std::str::FromStr;
use std::string::ToString;
use strum::{Display, EnumString, IntoStaticStr};
Expand Down

0 comments on commit b438893

Please sign in to comment.