ableos_userland/libraries/std/src/path.rs

19 lines
370 B
Rust
Raw Normal View History

2023-05-09 06:07:52 +00:00
use alloc::string::{String, ToString};
pub struct Path {
pub path: Vec<String>,
}
impl Path {
pub fn new(path: String) -> Self {
let mut path_vec_string = alloc::vec![];
for part in path.split(&['\\', '/'][..]) {
path_vec_string.push(part.to_string());
}
Path {
path: path_vec_string,
}
}
}