Rust 1.73

This commit is contained in:
Damien Elmes 2023-10-09 19:22:43 +10:00
parent f741b4af91
commit 961d7dfd72
6 changed files with 16 additions and 13 deletions

View File

@ -326,7 +326,8 @@ mod test {
let expected: Vec<_> = backups
.iter()
.filter_map(|b| b.1.then(|| b.0.clone()))
.filter(|b| b.1)
.map(|b| b.0.clone())
.collect();
let obsolete_backups =
BackupFilter::new(today, limits).obsolete_backups(backups.into_iter().map(|b| b.0));

View File

@ -546,7 +546,7 @@ fn notetype_conflicts(
if meta.notetype_id != note.notetype_id {
conflicts
.entry((meta.notetype_id, note.notetype_id))
.or_insert_with(Vec::new)
.or_default()
.push(note.id);
}
};

View File

@ -43,10 +43,11 @@ fn media_field_referencing_templates<'a>(
notetypes
.flat_map(|notetype| {
notetype.templates.iter().flat_map(|card_type| {
card_type.sides().into_iter().filter_map(|(format, front)| {
references_media_field(format)
.then(|| Template::new(&notetype.name, &card_type.name, front))
})
card_type
.sides()
.into_iter()
.filter(|&(format, _front)| references_media_field(format))
.map(|(_format, front)| Template::new(&notetype.name, &card_type.name, front))
})
})
.collect()

View File

@ -630,9 +630,8 @@ impl SqlWriter<'_> {
let matched_fields = nt
.fields
.iter()
.filter_map(|field| {
matches_glob(&field.name).then(|| field.ord.unwrap_or_default())
})
.filter(|&field| matches_glob(&field.name))
.map(|field| field.ord.unwrap_or_default())
.collect_ranges();
if !matched_fields.is_empty() {
field_map.push(FieldQualifiedSearchContext {
@ -660,9 +659,8 @@ impl SqlWriter<'_> {
let matched_fields: Vec<u32> = nt
.fields
.iter()
.filter_map(|field| {
matches_glob(&field.name).then(|| field.ord.unwrap_or_default())
})
.filter(|&field| matches_glob(&field.name))
.map(|field| field.ord.unwrap_or_default())
.collect();
if !matched_fields.is_empty() {
field_map.push((nt.id, matched_fields));

View File

@ -1,6 +1,9 @@
// Copyright: Ankitects Pty Ltd and contributors
// 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,
// and some impls on Backend and Collection.
include!(concat!(env!("OUT_DIR"), "/backend.rs"));

View File

@ -1,3 +1,3 @@
[toolchain]
# older versions may fail to compile; newer versions may fail the clippy tests
channel = "1.72"
channel = "1.73"