implemented bookmarks subcommand clean to remove entries with invalid

paths
This commit is contained in:
2025-07-03 23:48:24 +02:00
parent 86744ce8fa
commit 1005eddeb8
4 changed files with 13 additions and 1 deletions
+8
View File
@@ -101,6 +101,14 @@ impl Bookmarks {
Ok(())
}
///
pub fn remove_invalid_paths(&mut self) -> Result<()> {
self.bookmarks.retain(|_, path| path.is_dir());
self.write_bookmark_file()?;
Ok(())
}
/// formats and prints bookmarks to string
pub fn to_formatted_string(&self, config: &Config) -> Result<String> {
let mut buffer = String::new();