1
Fork 0

remove unneeded .as_ref() calls.

This commit is contained in:
Matthias Krüger 2020-02-29 02:16:04 +01:00
parent 0eb878d2aa
commit f55b2c9b12
3 changed files with 3 additions and 3 deletions

View file

@ -2011,7 +2011,7 @@ impl Path {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn file_name(&self) -> Option<&OsStr> {
self.components().next_back().and_then(|p| match p {
Component::Normal(p) => Some(p.as_ref()),
Component::Normal(p) => Some(p),
_ => None,
})
}