mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
manual_map
manual implementation of `Option::map`
This commit is contained in:
parent
8c85c5b7f4
commit
4c084c576a
@ -147,12 +147,10 @@ pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
} else if let Some(drive) = parse_drive(path) {
|
||||
// C:
|
||||
Some(Disk(drive))
|
||||
} else {
|
||||
// no prefix
|
||||
None
|
||||
// If it has a drive like `C:` then it's a disk.
|
||||
// Otherwise there is no prefix.
|
||||
parse_drive(path).map(Disk)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user