mirror of https://github.com/zkat/miette.git
clippy: tests: Fix useless conversion warnings.
This commit is contained in:
parent
379514c77d
commit
4d576d9e53
|
|
@ -189,7 +189,7 @@ fn fmt_help() {
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"1 x hello x \"2\"".to_string(),
|
"1 x hello x \"2\"".to_string(),
|
||||||
FooStruct("hello".into()).help().unwrap().to_string()
|
FooStruct("hello").help().unwrap().to_string()
|
||||||
);
|
);
|
||||||
|
|
||||||
#[derive(Debug, Diagnostic, Error)]
|
#[derive(Debug, Diagnostic, Error)]
|
||||||
|
|
@ -201,12 +201,7 @@ fn fmt_help() {
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"1 x hello x \"2\"".to_string(),
|
"1 x hello x \"2\"".to_string(),
|
||||||
BarStruct {
|
BarStruct { my_field: "hello" }.help().unwrap().to_string()
|
||||||
my_field: "hello".into()
|
|
||||||
}
|
|
||||||
.help()
|
|
||||||
.unwrap()
|
|
||||||
.to_string()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#[derive(Debug, Diagnostic, Error)]
|
#[derive(Debug, Diagnostic, Error)]
|
||||||
|
|
@ -224,7 +219,7 @@ fn fmt_help() {
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"1 x bar x \"2\"".to_string(),
|
"1 x bar x \"2\"".to_string(),
|
||||||
FooEnum::X("bar".into()).help().unwrap().to_string()
|
FooEnum::X("bar").help().unwrap().to_string()
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
@ -250,12 +245,7 @@ fn help_field() {
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"x".to_string(),
|
"x".to_string(),
|
||||||
Foo {
|
Foo { do_this: Some("x") }.help().unwrap().to_string()
|
||||||
do_this: Some("x".into())
|
|
||||||
}
|
|
||||||
.help()
|
|
||||||
.unwrap()
|
|
||||||
.to_string()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#[derive(Debug, Diagnostic, Error)]
|
#[derive(Debug, Diagnostic, Error)]
|
||||||
|
|
@ -271,16 +261,11 @@ fn help_field() {
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"x".to_string(),
|
"x".to_string(),
|
||||||
Bar::A(Some("x".into())).help().unwrap().to_string()
|
Bar::A(Some("x")).help().unwrap().to_string()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"x".to_string(),
|
"x".to_string(),
|
||||||
Bar::B {
|
Bar::B { do_this: Some("x") }.help().unwrap().to_string()
|
||||||
do_this: Some("x".into())
|
|
||||||
}
|
|
||||||
.help()
|
|
||||||
.unwrap()
|
|
||||||
.to_string()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#[derive(Debug, Diagnostic, Error)]
|
#[derive(Debug, Diagnostic, Error)]
|
||||||
|
|
@ -288,20 +273,14 @@ fn help_field() {
|
||||||
#[diagnostic()]
|
#[diagnostic()]
|
||||||
struct Baz<'a>(#[help] Option<&'a str>);
|
struct Baz<'a>(#[help] Option<&'a str>);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!("x".to_string(), Baz(Some("x")).help().unwrap().to_string());
|
||||||
"x".to_string(),
|
|
||||||
Baz(Some("x".into())).help().unwrap().to_string()
|
|
||||||
);
|
|
||||||
|
|
||||||
#[derive(Debug, Diagnostic, Error)]
|
#[derive(Debug, Diagnostic, Error)]
|
||||||
#[error("welp")]
|
#[error("welp")]
|
||||||
#[diagnostic()]
|
#[diagnostic()]
|
||||||
struct Quux<'a>(#[help] &'a str);
|
struct Quux<'a>(#[help] &'a str);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!("x".to_string(), Quux("x").help().unwrap().to_string());
|
||||||
"x".to_string(),
|
|
||||||
Quux("x".into()).help().unwrap().to_string()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -98,7 +97,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -144,7 +142,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -190,7 +187,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -235,7 +231,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -281,7 +276,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -347,7 +341,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -393,7 +386,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -456,7 +448,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -532,7 +523,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -588,7 +578,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -644,7 +633,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -700,7 +688,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -728,7 +715,6 @@ mod json_report_handler {
|
||||||
"related": []
|
"related": []
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -822,7 +808,6 @@ mod json_report_handler {
|
||||||
}]
|
}]
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
@ -920,7 +905,6 @@ mod json_report_handler {
|
||||||
}]
|
}]
|
||||||
}"#
|
}"#
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
.map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue