diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-09-19 21:10:14 +0200 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-09-19 21:10:14 +0200 |
commit | 4ea12514b7e9b016e249ebdaa9bda2e6a040f1b1 (patch) | |
tree | 30ca0b68c9f0bcb61f244f306e628865eeb586d4 /src/marks.rs | |
parent | d251d282a363affc7c85fb55a655daf1dda92724 (diff) |
log more messages to target special. Display last action in last line
Diffstat (limited to 'src/marks.rs')
-rw-r--r-- | src/marks.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/marks.rs b/src/marks.rs index f8f83a2..dad5749 100644 --- a/src/marks.rs +++ b/src/marks.rs @@ -97,8 +97,9 @@ impl Marks { /// Store a new mark in the config file. /// If an update is done, the marks are saved again. - pub fn new_mark(&mut self, ch: char, path: PathBuf) -> Result<()> { + pub fn new_mark(&mut self, ch: char, path: &Path) -> Result<()> { if ch == ':' { + log::info!(target: "special", "':' can't be used as a mark"); return Err(anyhow!("new_mark ':' can't be used as a mark")); } if self.used_chars.contains(&ch) { @@ -109,11 +110,14 @@ impl Marks { break; } } - let Some(found_index) = found_index else {return Ok(())}; - self.content[found_index] = (ch, path); + let Some(found_index) = found_index else { + return Ok(()); + }; + self.content[found_index] = (ch, path.to_path_buf()); } else { - self.content.push((ch, path)) + self.content.push((ch, path.to_path_buf())) } + log::info!(target: "special", "Saved mark {ch} -> {p}", p=path.display()); self.save_marks() } |