diff --git a/api-test/src/schema/string_list.rs b/api-test/src/schema/string_list.rs index 3aac603d..19608bac 100644 --- a/api-test/src/schema/string_list.rs +++ b/api-test/src/schema/string_list.rs @@ -62,9 +62,7 @@ impl<'de> serde::de::Visitor<'de> for StringListVisitor { } fn visit_seq>(self, mut seq: A) -> Result { - let mut out = seq - .size_hint() - .map_or_else(Vec::new, |size| Vec::with_capacity(size)); + let mut out = seq.size_hint().map_or_else(Vec::new, Vec::with_capacity); loop { match seq.next_element::()? { Some(el) => out.push(el), diff --git a/api-test/src/schema/string_set.rs b/api-test/src/schema/string_set.rs index 891287ec..20133e4d 100644 --- a/api-test/src/schema/string_set.rs +++ b/api-test/src/schema/string_set.rs @@ -13,7 +13,7 @@ pub trait ForEachStr { F: FnMut(&str) -> Result<(), Error>; } -impl ForEachStr for HashSet { +impl ForEachStr for HashSet { fn for_each_str(&self, mut func: F) -> Result<(), Error> where F: FnMut(&str) -> Result<(), Error>, @@ -69,7 +69,7 @@ impl<'de> serde::de::Visitor<'de> for StringSetVisitor { fn visit_seq>(self, mut seq: A) -> Result { let mut out = seq .size_hint() - .map_or_else(HashSet::new, |size| HashSet::with_capacity(size)); + .map_or_else(HashSet::new, HashSet::with_capacity); loop { match seq.next_element::()? { Some(el) => out.insert(el), diff --git a/api-test/src/schema/tools.rs b/api-test/src/schema/tools.rs index 376ea2e3..83376698 100644 --- a/api-test/src/schema/tools.rs +++ b/api-test/src/schema/tools.rs @@ -39,13 +39,13 @@ impl StringContainer for Option> { } } -impl StringContainer for HashSet { +impl StringContainer for HashSet { fn all bool>(&self, pred: F) -> bool { self.iter().all(|s| pred(s)) } } -impl StringContainer for Option> { +impl StringContainer for Option> { fn all bool>(&self, pred: F) -> bool { self.as_ref() .map(|c| StringContainer::all(c, pred))