diff --git a/src/clipboard.rs b/src/clipboard.rs index a8adb02..7435ffb 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -22,7 +22,7 @@ impl<'a> ClipboardHandler for Handler<'a> { .find(|subst| subst.matcher.check_match(&contents)) { if subst.name.is_empty().not() { - debug!("{}: matched on {}...", &subst.name, truncate(&contents, 40)); + debug!(?subst.name, ?contents); } let result = subst.action.apply_action(&contents); if let Err(e) = self.ctx.set_contents(result) { @@ -39,13 +39,6 @@ impl<'a> ClipboardHandler for Handler<'a> { } } -fn truncate(s: &str, max_chars: usize) -> &str { - match s.char_indices().nth(max_chars) { - None => s, - Some((idx, _)) => &s[..idx], - } -} - pub fn monitor(config: Replacements<'_>) { let ctx = ClipboardContext::new().expect("Failed to acquire clipboard"); let handler = Handler { ctx, config };