mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
parent
f93ee691d6
commit
1695587177
2 changed files with 16 additions and 5 deletions
|
@ -155,7 +155,11 @@ pub fn unique_in_place<T: Eq + std::hash::Hash + Clone>(v: &mut Vec<T>) {
|
|||
/// at least, this is necessary for Windows and macOS
|
||||
pub fn normalize_path(path: PathBuf) -> PathBuf {
|
||||
let verbatim_replaced = path.to_str().unwrap().replace("\\\\?\\", "");
|
||||
let lower = verbatim_replaced.to_lowercase();
|
||||
let lower = if cfg!(windows) {
|
||||
verbatim_replaced.to_lowercase()
|
||||
} else {
|
||||
verbatim_replaced
|
||||
};
|
||||
PathBuf::from(lower)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue