brk: first commit

This commit is contained in:
nym21
2025-02-23 01:25:15 +01:00
parent 8c3f519016
commit 19cf34f9d4
266 changed files with 225 additions and 1268 deletions

24
_src/structs/map_path.rs Normal file
View File

@@ -0,0 +1,24 @@
use std::path::PathBuf;
use allocative::Allocative;
use derive_deref::{Deref, DerefMut};
#[derive(Debug, Clone, Deref, DerefMut, Allocative)]
pub struct MapPath(PathBuf);
impl MapPath {
pub fn join(&self, path: &str) -> Self {
let path = path.replace(['-', '_', ' '], "/");
Self(self.0.join(path))
}
pub fn unwrap(&self) -> &PathBuf {
&self.0
}
}
impl From<PathBuf> for MapPath {
fn from(value: PathBuf) -> Self {
Self(value)
}
}