From 1ba4fc897985564f2debeb4b369d2da9b3671263 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Mon, 12 Oct 2020 15:30:24 -0700 Subject: Use Into::into in place of closures --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9672d33..e5c4804 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -495,7 +495,7 @@ impl Authority { pub fn set_userinfo(&mut self, userinfo: Option) where Vec: From { - self.userinfo = userinfo.map(|s| s.into()); + self.userinfo = userinfo.map(Into::into); } pub fn set_host(&mut self, host: T) @@ -1117,7 +1117,7 @@ impl Uri { } pub fn set_fragment(&mut self, fragment: Option<&[u8]>) { - self.fragment = fragment.map(|f| f.into()); + self.fragment = fragment.map(Into::into); } pub fn set_path<'a, T>(&mut self, path: T) @@ -1137,13 +1137,13 @@ impl Uri { } pub fn set_query(&mut self, query: Option<&[u8]>) { - self.query = query.map(|q| q.into()); + self.query = query.map(Into::into); } pub fn set_scheme(&mut self, scheme: Option) -> Result<(), Error> where String: From { - let scheme: Option = scheme.map(|s| s.into()); + let scheme: Option = scheme.map(Into::into); if let Some(scheme) = &scheme { Self::check_scheme(scheme)?; } -- cgit v1.2.3