diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-12 15:30:24 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-12 15:30:24 -0700 |
commit | 1ba4fc897985564f2debeb4b369d2da9b3671263 (patch) | |
tree | 1cdbe18d1e3532211707c4a4a8218d2140c9736c | |
parent | 463c8fb08fd5270a2f078affde992015cbb12165 (diff) |
Use Into::into in place of closures
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -495,7 +495,7 @@ impl Authority { pub fn set_userinfo<T>(&mut self, userinfo: Option<T>) where Vec<u8>: From<T> { - self.userinfo = userinfo.map(|s| s.into()); + self.userinfo = userinfo.map(Into::into); } pub fn set_host<T>(&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<T>(&mut self, scheme: Option<T>) -> Result<(), Error> where String: From<T> { - let scheme: Option<String> = scheme.map(|s| s.into()); + let scheme: Option<String> = scheme.map(Into::into); if let Some(scheme) = &scheme { Self::check_scheme(scheme)?; } |