mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 21:57:50 +02:00
Cargo clippy to simplify
This commit is contained in:
@ -153,11 +153,9 @@ pub mod _impl {
|
|||||||
|
|
||||||
/// Extract the drive letter from a path (e.g., `C:test` -> `C`)
|
/// Extract the drive letter from a path (e.g., `C:test` -> `C`)
|
||||||
fn extract_drive_letter(path: &Path) -> Option<char> {
|
fn extract_drive_letter(path: &Path) -> Option<char> {
|
||||||
Some(
|
|
||||||
path.to_str()
|
path.to_str()
|
||||||
.and_then(|s| s.chars().next())
|
.and_then(|s| s.chars().next())
|
||||||
.filter(|c| c.is_ascii_alphabetic())?,
|
.filter(|c| c.is_ascii_alphabetic())
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ensure a path has a trailing `\`
|
/// Ensure a path has a trailing `\`
|
||||||
|
Reference in New Issue
Block a user