mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
Add utils::to_utf
This commit is contained in:
parent
0c9131c307
commit
b45f38f5fa
@ -83,6 +83,11 @@ pub fn permission_for_overwriting(
|
|||||||
Flags::None => {}
|
Flags::None => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
let file_path_str = path.to_string_lossy();
|
let file_path_str = to_utf(path);
|
||||||
confirm.ask(Some(&file_path_str))
|
confirm.ask(Some(&file_path_str))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn to_utf(os_str: impl AsRef<OsStr>) -> String {
|
||||||
|
let text = format!("{:?}", os_str.as_ref());
|
||||||
|
text.trim_matches('"').to_string()
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user