mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Bump Rust version
This commit is contained in:
parent
0a0d17ff98
commit
f497bd6a33
11 changed files with 16 additions and 44 deletions
|
@ -6,12 +6,13 @@ use std::fmt::Display;
|
|||
|
||||
use camino::Utf8PathBuf;
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[derive(Debug, Clone, Hash, Default)]
|
||||
pub enum BuildInput {
|
||||
Single(String),
|
||||
Multiple(Vec<String>),
|
||||
Glob(Glob),
|
||||
Inputs(Vec<BuildInput>),
|
||||
#[default]
|
||||
Empty,
|
||||
}
|
||||
|
||||
|
@ -21,12 +22,6 @@ impl AsRef<BuildInput> for BuildInput {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for BuildInput {
|
||||
fn default() -> Self {
|
||||
BuildInput::Empty
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for BuildInput {
|
||||
fn from(v: String) -> Self {
|
||||
BuildInput::Single(v)
|
||||
|
|
|
@ -23,8 +23,10 @@ use crate::text::html_to_text_line;
|
|||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Display, EnumIter, EnumString)]
|
||||
#[strum(serialize_all = "camelCase")]
|
||||
#[derive(Default)]
|
||||
pub enum Column {
|
||||
#[strum(serialize = "")]
|
||||
#[default]
|
||||
Custom,
|
||||
Answer,
|
||||
CardMod,
|
||||
|
@ -53,12 +55,6 @@ pub enum Column {
|
|||
Tags,
|
||||
}
|
||||
|
||||
impl Default for Column {
|
||||
fn default() -> Self {
|
||||
Column::Custom
|
||||
}
|
||||
}
|
||||
|
||||
struct RowContext {
|
||||
notes_mode: bool,
|
||||
cards: Vec<Card>,
|
||||
|
|
|
@ -287,18 +287,14 @@ impl Collection {
|
|||
}
|
||||
|
||||
// 2021 scheduler moves this into deck config
|
||||
#[derive(Default)]
|
||||
pub(crate) enum NewReviewMix {
|
||||
#[default]
|
||||
Mix = 0,
|
||||
ReviewsFirst = 1,
|
||||
NewFirst = 2,
|
||||
}
|
||||
|
||||
impl Default for NewReviewMix {
|
||||
fn default() -> Self {
|
||||
NewReviewMix::Mix
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Serialize_repr, Deserialize_repr, Clone, Copy)]
|
||||
#[repr(u8)]
|
||||
pub(crate) enum Weekday {
|
||||
|
|
|
@ -163,8 +163,10 @@ pub struct RevConfSchema11 {
|
|||
|
||||
#[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, Clone)]
|
||||
#[repr(u8)]
|
||||
#[derive(Default)]
|
||||
pub enum LeechAction {
|
||||
Suspend = 0,
|
||||
#[default]
|
||||
TagOnly = 1,
|
||||
}
|
||||
|
||||
|
@ -183,12 +185,6 @@ pub struct LapseConfSchema11 {
|
|||
other: HashMap<String, Value>,
|
||||
}
|
||||
|
||||
impl Default for LeechAction {
|
||||
fn default() -> Self {
|
||||
LeechAction::TagOnly
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for RevConfSchema11 {
|
||||
fn default() -> Self {
|
||||
RevConfSchema11 {
|
||||
|
|
|
@ -155,7 +155,6 @@ impl ColumnContext {
|
|||
) -> Result<Vec<ForeignNote>> {
|
||||
reader
|
||||
.records()
|
||||
.into_iter()
|
||||
.map(|res| {
|
||||
res.or_invalid("invalid csv")
|
||||
.map(|record| self.foreign_note_from_record(&record))
|
||||
|
|
|
@ -302,7 +302,6 @@ fn collect_preview_records(
|
|||
let mut csv_reader = build_csv_reader(reader, metadata.delimiter())?;
|
||||
csv_reader
|
||||
.records()
|
||||
.into_iter()
|
||||
.take(PREVIEW_LENGTH)
|
||||
.collect::<csv::Result<_>>()
|
||||
.or_invalid("invalid csv")
|
||||
|
|
|
@ -60,7 +60,9 @@ pub struct RevlogEntry {
|
|||
|
||||
#[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, TryFromPrimitive, Clone, Copy)]
|
||||
#[repr(u8)]
|
||||
#[derive(Default)]
|
||||
pub enum RevlogReviewKind {
|
||||
#[default]
|
||||
Learning = 0,
|
||||
Review = 1,
|
||||
Relearning = 2,
|
||||
|
@ -71,12 +73,6 @@ pub enum RevlogReviewKind {
|
|||
Manual = 4,
|
||||
}
|
||||
|
||||
impl Default for RevlogReviewKind {
|
||||
fn default() -> Self {
|
||||
RevlogReviewKind::Learning
|
||||
}
|
||||
}
|
||||
|
||||
impl RevlogEntry {
|
||||
pub(crate) fn interval_secs(&self) -> u32 {
|
||||
u32::try_from(if self.interval > 0 {
|
||||
|
|
|
@ -597,7 +597,7 @@ fn parse_mid(s: &str) -> ParseResult<SearchNode> {
|
|||
|
||||
/// ensure a list of ids contains only numbers and commas, returning unchanged
|
||||
/// if true used by nid: and cid:
|
||||
fn check_id_list<'a, 'b>(s: &'a str, context: &'b str) -> ParseResult<'a, &'a str> {
|
||||
fn check_id_list<'a>(s: &'a str, context: &str) -> ParseResult<'a, &'a str> {
|
||||
lazy_static! {
|
||||
static ref RE: Regex = Regex::new(r"^(\d+,)*\d+$").unwrap();
|
||||
}
|
||||
|
|
|
@ -7,19 +7,14 @@ use crate::sync::collection::protocol::SyncProtocol;
|
|||
use crate::sync::http_client::HttpSyncClient;
|
||||
use crate::sync::login::SyncAuth;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum SyncStage {
|
||||
#[default]
|
||||
Connecting,
|
||||
Syncing,
|
||||
Finalizing,
|
||||
}
|
||||
|
||||
impl Default for SyncStage {
|
||||
fn default() -> Self {
|
||||
SyncStage::Connecting
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
pub struct FullSyncProgress {
|
||||
pub transferred_bytes: usize,
|
||||
|
|
|
@ -63,9 +63,9 @@ pub(crate) fn apply_filters<'a>(
|
|||
///
|
||||
/// Returns true if filter was valid.
|
||||
/// Returns string if input text changed.
|
||||
fn apply_filter<'a>(
|
||||
fn apply_filter(
|
||||
filter_name: &str,
|
||||
text: &'a str,
|
||||
text: &str,
|
||||
field_name: &str,
|
||||
context: &RenderContext,
|
||||
) -> (bool, Option<String>) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[toolchain]
|
||||
# older versions may fail to compile; newer versions may fail the clippy tests
|
||||
channel = "1.66.1"
|
||||
channel = "1.68.2"
|
||||
|
|
Loading…
Reference in a new issue