add rename_part

This commit is contained in:
weisd
2024-09-25 11:49:12 +08:00
parent 43c94c7be2
commit ad4a32762d
7 changed files with 358 additions and 16 deletions
+6
View File
@@ -1,3 +1,5 @@
use std::path::Path;
const GLOBAL_DIR_SUFFIX: &str = "__XLDIR__";
pub const SLASH_SEPARATOR: &str = "/";
@@ -37,3 +39,7 @@ pub fn retain_slash(s: &str) -> String {
format!("{}{}", s, SLASH_SEPARATOR)
}
}
pub fn join(p1: &str, p2: &str) -> String {
Path::new(p1).join(Path::new(p2)).to_string_lossy().to_string()
}