From 0038430192bf1f78f65288b823abec8c6bdc5cc8 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 10 Oct 2016 19:46:18 -0400 Subject: [PATCH] Simplify `str` and `Path` comparison. --- src/librustc/session/filesearch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs index a589840e5ced..82c2425aead7 100644 --- a/src/librustc/session/filesearch.rs +++ b/src/librustc/session/filesearch.rs @@ -75,7 +75,7 @@ impl<'a> FileSearch<'a> { let files = files.filter_map(|p| p.ok().map(|s| s.path())) .collect::>(); fn is_rlib(p: &Path) -> bool { - p.extension().and_then(|s| s.to_str()) == Some("rlib") + p.extension() == Some("rlib".as_ref()) } // Reading metadata out of rlibs is faster, and if we find both // an rlib and a dylib we only read one of the files of