ableos_userland/libraries/relib/src/lib.rs

28 lines
441 B
Rust

#![no_std]
use alloc::{
string::{String, ToString},
vec::Vec,
};
extern crate alloc;
#[derive(Debug)]
pub struct Path {
pub path: Vec<String>,
}
impl Path {
pub fn new(path: String) -> Self {
let mut path_vec_string = Vec::new();
for part in path.split(&['\\', '/'][..]) {
path_vec_string.push(part.to_string());
}
Path {
path: path_vec_string,
}
}
}