mirror of
https://github.com/rui314/mold.git
synced 2026-11-09 04:49:33 -10:00
Remove the unused path_dirname helper
This commit is contained in:
1 parent
900d689cb3
commit
73c5095f1e
1 file changed
-8
@@ -292,14 +292,6 @@ pub fn clean_path(path: &std::path::Path) -> std::path::PathBuf {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the directory part of a path, as `dirname(1)` would.
|
||||
pub fn path_dirname(path: &str) -> String {
|
||||
match std::path::Path::new(path).parent() {
|
||||
Some(parent) if !parent.as_os_str().is_empty() => parent.to_string_lossy().into_owned(),
|
||||
_ => ".".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Formats a byte string for diagnostics, replacing invalid UTF-8.
|
||||
pub fn display(bytes: &[u8]) -> std::borrow::Cow<'_, str> {
|
||||
String::from_utf8_lossy(bytes)
|
||||
|
||||
Reference in new issue
Block a user