implemented (separate) punctuation-style for stack and bookmarks
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
use std::{
|
||||
io::Result,
|
||||
path::{Component, PathBuf},
|
||||
};
|
||||
|
||||
pub fn to_lexical_absolute(path: PathBuf) -> Result<PathBuf> {
|
||||
let mut absolute = if path.is_absolute() {
|
||||
std::path::PathBuf::new()
|
||||
} else {
|
||||
std::env::current_dir()?
|
||||
}; for component in path.components() {
|
||||
match component {
|
||||
Component::CurDir => {},
|
||||
Component::ParentDir => { absolute.pop(); },
|
||||
component @ _ => absolute.push(component.as_os_str()),
|
||||
}
|
||||
}
|
||||
Ok(absolute)
|
||||
}
|
||||
Reference in New Issue
Block a user