From e108b360f1dc8e7d324b19fdbb4797db72380470 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Sun, 30 Jan 2022 09:57:44 +0100 Subject: [PATCH] Fix some clippy warnings --- src/rtfmt.rs | 2 +- src/tree.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtfmt.rs b/src/rtfmt.rs index 2437423..26648f3 100644 --- a/src/rtfmt.rs +++ b/src/rtfmt.rs @@ -89,7 +89,7 @@ pub fn format(fmt: &str, arg: &str, clipped_str: &str) -> String { } } -fn remove_last_n_chars(s: &mut String, n: usize) -> () { +fn remove_last_n_chars(s: &mut String, n: usize) { match s.char_indices().nth_back(n) { Some((pos, ch)) => s.truncate(pos + ch.len_utf8()), None => s.clear(), diff --git a/src/tree.rs b/src/tree.rs index eb5e64f..eb32493 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -536,7 +536,7 @@ impl DisplayFormat for DisplayNode<'_> { maybe_html_escape( html_escape, - rtfmt::format(fmt_str, &value, &clipped_str), + rtfmt::format(fmt_str, &value, clipped_str), ) }) .into()