Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Oct 26, 2022
1 parent 32bde7e commit 35ae9ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions viz-core/src/types/params/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ mod tests {
let i: Result<Test3, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(i.is_err());
assert!(format!("{:?}", i).contains("unknown variant"));
assert!(format!("{i:?}").contains("unknown variant"));
}

#[test]
Expand All @@ -692,22 +692,22 @@ mod tests {
let s: Result<Test1, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("wrong number of parameters"));
assert!(format!("{s:?}").contains("wrong number of parameters"));

let s: Result<Test2, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("can not parse"));
assert!(format!("{s:?}").contains("can not parse"));

let s: Result<(String, String), de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("wrong number of parameters"));
assert!(format!("{s:?}").contains("wrong number of parameters"));

let s: Result<u32, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("can not parse"));
assert!(format!("{s:?}").contains("can not parse"));

#[derive(Debug, Deserialize)]
struct S {
Expand All @@ -716,17 +716,17 @@ mod tests {
let s: Result<S, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("missing field `_inner`"));
assert!(format!("{s:?}").contains("missing field `_inner`"));

let params: Params = vec![].into();
let s: Result<&str, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("wrong number of parameters: 0 expected 1"));
assert!(format!("{s:?}").contains("wrong number of parameters: 0 expected 1"));

let s: Result<TestEnum, de::value::Error> =
de::Deserialize::deserialize(PathDeserializer::new(&params));
assert!(s.is_err());
assert!(format!("{:?}", s).contains("expeceted at least one parameters"));
assert!(format!("{s:?}").contains("expeceted at least one parameters"));
}
}

0 comments on commit 35ae9ce

Please sign in to comment.