fix new clippy lints

This commit is contained in:
Damien Elmes 2020-10-09 21:35:53 +10:00
parent 0d4e05e6a4
commit c96784c0eb
3 changed files with 3 additions and 5 deletions

View File

@ -40,6 +40,7 @@ impl MediaManager {
/// appended to the name.
///
/// Also notes the file in the media database.
#[allow(clippy::match_like_matches_macro)]
pub fn add_file<'a>(
&self,
ctx: &mut MediaDatabaseContext,

View File

@ -515,7 +515,7 @@ mod test {
col.update_note(&mut note)?;
let existing = col.storage.existing_cards_for_note(note.id)?;
let mut ords = existing.iter().map(|a| a.ord).collect::<Vec<_>>();
ords.sort();
ords.sort_unstable();
assert_eq!(ords, vec![0, 1, 2, 499]);
Ok(())

View File

@ -160,10 +160,7 @@ fn write_order(sql: &mut String, kind: SortKind, reverse: bool) -> Result<()> {
fn needs_aux_sort_table(kind: SortKind) -> bool {
use SortKind::*;
match kind {
CardDeck | NoteType | CardTemplate => true,
_ => false,
}
matches!(kind, CardDeck | NoteType | CardTemplate)
}
fn prepare_sort(col: &mut Collection, kind: SortKind) -> Result<()> {