mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Rust 1.73
This commit is contained in:
parent
f741b4af91
commit
961d7dfd72
6 changed files with 16 additions and 13 deletions
|
@ -326,7 +326,8 @@ mod test {
|
||||||
|
|
||||||
let expected: Vec<_> = backups
|
let expected: Vec<_> = backups
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|b| b.1.then(|| b.0.clone()))
|
.filter(|b| b.1)
|
||||||
|
.map(|b| b.0.clone())
|
||||||
.collect();
|
.collect();
|
||||||
let obsolete_backups =
|
let obsolete_backups =
|
||||||
BackupFilter::new(today, limits).obsolete_backups(backups.into_iter().map(|b| b.0));
|
BackupFilter::new(today, limits).obsolete_backups(backups.into_iter().map(|b| b.0));
|
||||||
|
|
|
@ -546,7 +546,7 @@ fn notetype_conflicts(
|
||||||
if meta.notetype_id != note.notetype_id {
|
if meta.notetype_id != note.notetype_id {
|
||||||
conflicts
|
conflicts
|
||||||
.entry((meta.notetype_id, note.notetype_id))
|
.entry((meta.notetype_id, note.notetype_id))
|
||||||
.or_insert_with(Vec::new)
|
.or_default()
|
||||||
.push(note.id);
|
.push(note.id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,10 +43,11 @@ fn media_field_referencing_templates<'a>(
|
||||||
notetypes
|
notetypes
|
||||||
.flat_map(|notetype| {
|
.flat_map(|notetype| {
|
||||||
notetype.templates.iter().flat_map(|card_type| {
|
notetype.templates.iter().flat_map(|card_type| {
|
||||||
card_type.sides().into_iter().filter_map(|(format, front)| {
|
card_type
|
||||||
references_media_field(format)
|
.sides()
|
||||||
.then(|| Template::new(¬etype.name, &card_type.name, front))
|
.into_iter()
|
||||||
})
|
.filter(|&(format, _front)| references_media_field(format))
|
||||||
|
.map(|(_format, front)| Template::new(¬etype.name, &card_type.name, front))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
|
|
|
@ -630,9 +630,8 @@ impl SqlWriter<'_> {
|
||||||
let matched_fields = nt
|
let matched_fields = nt
|
||||||
.fields
|
.fields
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|field| {
|
.filter(|&field| matches_glob(&field.name))
|
||||||
matches_glob(&field.name).then(|| field.ord.unwrap_or_default())
|
.map(|field| field.ord.unwrap_or_default())
|
||||||
})
|
|
||||||
.collect_ranges();
|
.collect_ranges();
|
||||||
if !matched_fields.is_empty() {
|
if !matched_fields.is_empty() {
|
||||||
field_map.push(FieldQualifiedSearchContext {
|
field_map.push(FieldQualifiedSearchContext {
|
||||||
|
@ -660,9 +659,8 @@ impl SqlWriter<'_> {
|
||||||
let matched_fields: Vec<u32> = nt
|
let matched_fields: Vec<u32> = nt
|
||||||
.fields
|
.fields
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|field| {
|
.filter(|&field| matches_glob(&field.name))
|
||||||
matches_glob(&field.name).then(|| field.ord.unwrap_or_default())
|
.map(|field| field.ord.unwrap_or_default())
|
||||||
})
|
|
||||||
.collect();
|
.collect();
|
||||||
if !matched_fields.is_empty() {
|
if !matched_fields.is_empty() {
|
||||||
field_map.push((nt.id, matched_fields));
|
field_map.push((nt.id, matched_fields));
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
#![allow(clippy::redundant_closure)]
|
||||||
|
|
||||||
// Includes the automatically-generated *Service and Backend*Service traits,
|
// Includes the automatically-generated *Service and Backend*Service traits,
|
||||||
// and some impls on Backend and Collection.
|
// and some impls on Backend and Collection.
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/backend.rs"));
|
include!(concat!(env!("OUT_DIR"), "/backend.rs"));
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
# older versions may fail to compile; newer versions may fail the clippy tests
|
# older versions may fail to compile; newer versions may fail the clippy tests
|
||||||
channel = "1.72"
|
channel = "1.73"
|
||||||
|
|
Loading…
Reference in a new issue