From 26123ce229623f4f96e6ccf5100d82fe24d15ba9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 18 Nov 2021 20:51:10 +1000 Subject: [PATCH] update to edition 2021 --- defs.bzl | 2 +- pylib/rsbridge/Cargo.toml | 2 +- qt/package/Cargo.toml | 2 +- rslib/Cargo.toml | 2 +- rslib/i18n/Cargo.toml | 2 +- rslib/i18n_helpers/Cargo.toml | 2 +- rslib/src/backend/card.rs | 2 -- rslib/src/backend/search/mod.rs | 2 +- rslib/src/backend/search/search_node.rs | 2 -- rslib/src/notes/mod.rs | 1 - rslib/src/scheduler/filtered/mod.rs | 2 -- 11 files changed, 7 insertions(+), 14 deletions(-) diff --git a/defs.bzl b/defs.bzl index da2db498c..4e068c264 100644 --- a/defs.bzl +++ b/defs.bzl @@ -18,7 +18,7 @@ def setup_deps(): versions.check(minimum_bazel_version = "3.7.0") rust_repositories( - edition = "2018", + edition = "2021", include_rustc_srcs = False, ) diff --git a/pylib/rsbridge/Cargo.toml b/pylib/rsbridge/Cargo.toml index 7b9f7926f..f5b234246 100644 --- a/pylib/rsbridge/Cargo.toml +++ b/pylib/rsbridge/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rsbridge" version = "0.0.0" -edition = "2018" +edition = "2021" authors = ["Ankitects Pty Ltd and contributors "] license = "AGPL-3.0-or-later" description = "Anki's Rust library code Python bindings" diff --git a/qt/package/Cargo.toml b/qt/package/Cargo.toml index e5be3f0cb..acf98f1f1 100644 --- a/qt/package/Cargo.toml +++ b/qt/package/Cargo.toml @@ -2,7 +2,7 @@ name = "anki" version = "0.1.0" build = "build.rs" -edition = "2018" +edition = "2021" [target.'cfg(windows)'.dependencies] winapi = {version = "0.3", features = ["wincon"]} diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml index da057b894..93264282d 100644 --- a/rslib/Cargo.toml +++ b/rslib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "anki" version = "0.0.0" -edition = "2018" +edition = "2021" authors = ["Ankitects Pty Ltd and contributors"] license = "AGPL-3.0-or-later" description = "Anki's Rust library code" diff --git a/rslib/i18n/Cargo.toml b/rslib/i18n/Cargo.toml index 399c30dc8..d55ca521b 100644 --- a/rslib/i18n/Cargo.toml +++ b/rslib/i18n/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "anki_i18n" version = "0.0.0" -edition = "2018" +edition = "2021" authors = ["Ankitects Pty Ltd and contributors"] license = "AGPL-3.0-or-later" description = "Anki's Rust library i18n code" diff --git a/rslib/i18n_helpers/Cargo.toml b/rslib/i18n_helpers/Cargo.toml index e9f630384..215d92b7f 100644 --- a/rslib/i18n_helpers/Cargo.toml +++ b/rslib/i18n_helpers/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "anki_i18n_helpers" version = "0.0.0" -edition = "2018" +edition = "2021" authors = ["Ankitects Pty Ltd and contributors"] license = "AGPL-3.0-or-later" description = "Helpers for Anki's i18n system" diff --git a/rslib/src/backend/card.rs b/rslib/src/backend/card.rs index 72d3e1bfb..5d1d43fe0 100644 --- a/rslib/src/backend/card.rs +++ b/rslib/src/backend/card.rs @@ -1,8 +1,6 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -use std::convert::{TryFrom, TryInto}; - use super::Backend; pub(super) use crate::backend_proto::cards_service::Service as CardsService; use crate::{ diff --git a/rslib/src/backend/search/mod.rs b/rslib/src/backend/search/mod.rs index 22fc04274..40e4c7f8a 100644 --- a/rslib/src/backend/search/mod.rs +++ b/rslib/src/backend/search/mod.rs @@ -4,7 +4,7 @@ mod browser_table; mod search_node; -use std::{convert::TryInto, str::FromStr, sync::Arc}; +use std::{str::FromStr, sync::Arc}; use super::{notes::to_note_ids, Backend}; pub(super) use crate::backend_proto::search_service::Service as SearchService; diff --git a/rslib/src/backend/search/search_node.rs b/rslib/src/backend/search/search_node.rs index d184dc66f..02a2c906c 100644 --- a/rslib/src/backend/search/search_node.rs +++ b/rslib/src/backend/search/search_node.rs @@ -1,8 +1,6 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -use std::convert::{TryFrom, TryInto}; - use itertools::Itertools; use crate::{ diff --git a/rslib/src/notes/mod.rs b/rslib/src/notes/mod.rs index f78466e74..5eed822f4 100644 --- a/rslib/src/notes/mod.rs +++ b/rslib/src/notes/mod.rs @@ -6,7 +6,6 @@ pub(crate) mod undo; use std::{ borrow::Cow, collections::{HashMap, HashSet}, - convert::TryInto, }; use itertools::Itertools; diff --git a/rslib/src/scheduler/filtered/mod.rs b/rslib/src/scheduler/filtered/mod.rs index f467acb64..f8710dc42 100644 --- a/rslib/src/scheduler/filtered/mod.rs +++ b/rslib/src/scheduler/filtered/mod.rs @@ -3,8 +3,6 @@ mod card; -use std::convert::{TryFrom, TryInto}; - use crate::{ config::{ConfigKey, SchedulerVersion}, decks::{FilteredDeck, FilteredSearchTerm},