improved output of book remove & added todo

This commit is contained in:
scbj
2025-07-09 10:39:33 +02:00
parent 3eee1e304c
commit 4e8c311476
3 changed files with 12 additions and 7 deletions
+7 -3
View File
@@ -89,16 +89,20 @@ impl Bookmarks {
}
/// removes a the entry with key=name if it exists, then writes the bookmarks file
pub fn remove_bookmark(&mut self, name: &String) -> Result<()> {
pub fn remove_bookmark(&mut self, name: &String) -> Result<PathBuf> {
let path: PathBuf;
if self.bookmarks.contains_key(name) {
_ = self.bookmarks.remove(name);
path = match self.bookmarks.remove(name) {
Some(path) => path,
None => return Err(Error::other("-- those bastards, they lied to me!")),
};
self.write_bookmark_file()?;
} else {
return Err(Error::other(
"-- bookmark requested to delete does not exist",
));
}
Ok(())
Ok(path)
}
///