mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix new clippy lints
This commit is contained in:
parent
0d4e05e6a4
commit
c96784c0eb
3 changed files with 3 additions and 5 deletions
|
@ -40,6 +40,7 @@ impl MediaManager {
|
||||||
/// appended to the name.
|
/// appended to the name.
|
||||||
///
|
///
|
||||||
/// Also notes the file in the media database.
|
/// Also notes the file in the media database.
|
||||||
|
#[allow(clippy::match_like_matches_macro)]
|
||||||
pub fn add_file<'a>(
|
pub fn add_file<'a>(
|
||||||
&self,
|
&self,
|
||||||
ctx: &mut MediaDatabaseContext,
|
ctx: &mut MediaDatabaseContext,
|
||||||
|
|
|
@ -515,7 +515,7 @@ mod test {
|
||||||
col.update_note(&mut note)?;
|
col.update_note(&mut note)?;
|
||||||
let existing = col.storage.existing_cards_for_note(note.id)?;
|
let existing = col.storage.existing_cards_for_note(note.id)?;
|
||||||
let mut ords = existing.iter().map(|a| a.ord).collect::<Vec<_>>();
|
let mut ords = existing.iter().map(|a| a.ord).collect::<Vec<_>>();
|
||||||
ords.sort();
|
ords.sort_unstable();
|
||||||
assert_eq!(ords, vec![0, 1, 2, 499]);
|
assert_eq!(ords, vec![0, 1, 2, 499]);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -160,10 +160,7 @@ fn write_order(sql: &mut String, kind: SortKind, reverse: bool) -> Result<()> {
|
||||||
|
|
||||||
fn needs_aux_sort_table(kind: SortKind) -> bool {
|
fn needs_aux_sort_table(kind: SortKind) -> bool {
|
||||||
use SortKind::*;
|
use SortKind::*;
|
||||||
match kind {
|
matches!(kind, CardDeck | NoteType | CardTemplate)
|
||||||
CardDeck | NoteType | CardTemplate => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_sort(col: &mut Collection, kind: SortKind) -> Result<()> {
|
fn prepare_sort(col: &mut Collection, kind: SortKind) -> Result<()> {
|
||||||
|
|
Loading…
Reference in a new issue