diff options
Diffstat (limited to 'src/urlutil.rs')
| -rw-r--r-- | src/urlutil.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/urlutil.rs b/src/urlutil.rs index 12f74e5..26677c3 100644 --- a/src/urlutil.rs +++ b/src/urlutil.rs @@ -10,7 +10,7 @@ fn host_of(source: &str) -> Option<String> { } pub fn hosts(sources: &[String]) -> BTreeSet<String> { - sources.iter().map(|s| s.as_str()).filter_map(host_of).collect() + sources.iter().map(std::string::String::as_str).filter_map(host_of).collect() } #[cfg(test)] @@ -25,10 +25,7 @@ mod tests { #[test] fn scheme_and_filename_prefixes_are_stripped() { assert_eq!(host_of("git+https://github.com/a/b.git").as_deref(), Some("github.com")); - assert_eq!( - host_of("myname::https://cdn.example.org/x.tar").as_deref(), - Some("cdn.example.org") - ); + assert_eq!(host_of("myname::https://cdn.example.org/x.tar").as_deref(), Some("cdn.example.org")); assert_eq!( host_of("myname::git+ssh://git@gitlab.example.org/a/b.git").as_deref(), Some("gitlab.example.org"), |
