bitrot(1)

Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
junxiang Mu
2024-10-24 10:16:52 +08:00
parent 49593dd77d
commit edb1e692f1
9 changed files with 274 additions and 15 deletions
+12
View File
@@ -1,3 +1,5 @@
use std::path::PathBuf;
const GLOBAL_DIR_SUFFIX: &str = "__XLDIR__";
pub const SLASH_SEPARATOR: &str = "/";
@@ -50,6 +52,16 @@ pub fn has_profix(s: &str, prefix: &str) -> bool {
s.starts_with(prefix)
}
pub fn path_join(elem: &[PathBuf]) -> PathBuf {
let mut joined_path = PathBuf::new();
for path in elem {
joined_path.push(path);
}
joined_path
}
pub struct LazyBuf {
s: String,
buf: Option<Vec<u8>>,