Fix clippy.
All checks were successful
clippy Build clippy has succeeded
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded

This commit is contained in:
Tom Alexander 2023-12-15 19:57:35 -05:00
parent e24fcb9ded
commit 5a8159eed7
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 4 additions and 4 deletions

View File

@ -285,7 +285,7 @@ where
pub(crate) fn compare_children<'b, 's, 'x, RC>(
source: &'s str,
emacs: &'b Token<'s>,
rust_children: &'x Vec<RC>,
rust_children: &'x [RC],
child_status: &mut Vec<DiffEntry<'b, 's>>,
this_status: &mut DiffStatus,
message: &mut Option<String>,

View File

@ -27,7 +27,7 @@ pub(crate) fn record_event(event_type: EventType, input: OrgSource<'_>) {
pub fn report(original_document: &str) {
let mut db = GLOBAL_DATA.lock().unwrap();
let db = db.get_or_insert_with(HashMap::new);
let mut results: Vec<_> = db.iter().map(|(k, v)| (k, v)).collect();
let mut results: Vec<_> = db.iter().collect();
results.sort_by_key(|(_k, v)| *v);
// This would put the most common at the top, but that is a pain when there is already a lot of output from the parser.
// results.sort_by(|(_ak, av), (_bk, bv)| bv.cmp(av));

View File

@ -84,7 +84,7 @@ pub(crate) fn broken_end<'b, 'g, 'r, 's>(
Paragraph::of_text(
input.get_until(remaining).into(),
body,
if body.len() > 0 { Some(body) } else { None },
if !body.is_empty() { Some(body) } else { None },
post_blank.map(Into::<&str>::into),
),
))
@ -145,7 +145,7 @@ pub(crate) fn broken_dynamic_block<'b, 'g, 'r, 's>(
Paragraph::of_text(
input.get_until(remaining).into(),
body,
if body.len() > 0 { Some(body) } else { None },
if !body.is_empty() { Some(body) } else { None },
post_blank.map(Into::<&str>::into),
),
))