diff --git a/src/compare/util.rs b/src/compare/util.rs index 79cefcd2..9029b243 100644 --- a/src/compare/util.rs +++ b/src/compare/util.rs @@ -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, + rust_children: &'x [RC], child_status: &mut Vec>, this_status: &mut DiffStatus, message: &mut Option, diff --git a/src/event_count/database.rs b/src/event_count/database.rs index 1b763e0d..c9adbcfc 100644 --- a/src/event_count/database.rs +++ b/src/event_count/database.rs @@ -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)); diff --git a/src/parser/bullshitium.rs b/src/parser/bullshitium.rs index 52e97d0b..597d433c 100644 --- a/src/parser/bullshitium.rs +++ b/src/parser/bullshitium.rs @@ -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), ), ))