Bump Rust version

This commit is contained in:
Damien Elmes 2023-03-31 14:11:33 +10:00
parent 0a0d17ff98
commit f497bd6a33
11 changed files with 16 additions and 44 deletions

View file

@ -6,12 +6,13 @@ use std::fmt::Display;
use camino::Utf8PathBuf; use camino::Utf8PathBuf;
#[derive(Debug, Clone, Hash)] #[derive(Debug, Clone, Hash, Default)]
pub enum BuildInput { pub enum BuildInput {
Single(String), Single(String),
Multiple(Vec<String>), Multiple(Vec<String>),
Glob(Glob), Glob(Glob),
Inputs(Vec<BuildInput>), Inputs(Vec<BuildInput>),
#[default]
Empty, Empty,
} }
@ -21,12 +22,6 @@ impl AsRef<BuildInput> for BuildInput {
} }
} }
impl Default for BuildInput {
fn default() -> Self {
BuildInput::Empty
}
}
impl From<String> for BuildInput { impl From<String> for BuildInput {
fn from(v: String) -> Self { fn from(v: String) -> Self {
BuildInput::Single(v) BuildInput::Single(v)

View file

@ -23,8 +23,10 @@ use crate::text::html_to_text_line;
#[derive(Debug, PartialEq, Eq, Clone, Copy, Display, EnumIter, EnumString)] #[derive(Debug, PartialEq, Eq, Clone, Copy, Display, EnumIter, EnumString)]
#[strum(serialize_all = "camelCase")] #[strum(serialize_all = "camelCase")]
#[derive(Default)]
pub enum Column { pub enum Column {
#[strum(serialize = "")] #[strum(serialize = "")]
#[default]
Custom, Custom,
Answer, Answer,
CardMod, CardMod,
@ -53,12 +55,6 @@ pub enum Column {
Tags, Tags,
} }
impl Default for Column {
fn default() -> Self {
Column::Custom
}
}
struct RowContext { struct RowContext {
notes_mode: bool, notes_mode: bool,
cards: Vec<Card>, cards: Vec<Card>,

View file

@ -287,18 +287,14 @@ impl Collection {
} }
// 2021 scheduler moves this into deck config // 2021 scheduler moves this into deck config
#[derive(Default)]
pub(crate) enum NewReviewMix { pub(crate) enum NewReviewMix {
#[default]
Mix = 0, Mix = 0,
ReviewsFirst = 1, ReviewsFirst = 1,
NewFirst = 2, NewFirst = 2,
} }
impl Default for NewReviewMix {
fn default() -> Self {
NewReviewMix::Mix
}
}
#[derive(PartialEq, Eq, Serialize_repr, Deserialize_repr, Clone, Copy)] #[derive(PartialEq, Eq, Serialize_repr, Deserialize_repr, Clone, Copy)]
#[repr(u8)] #[repr(u8)]
pub(crate) enum Weekday { pub(crate) enum Weekday {

View file

@ -163,8 +163,10 @@ pub struct RevConfSchema11 {
#[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, Clone)] #[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, Clone)]
#[repr(u8)] #[repr(u8)]
#[derive(Default)]
pub enum LeechAction { pub enum LeechAction {
Suspend = 0, Suspend = 0,
#[default]
TagOnly = 1, TagOnly = 1,
} }
@ -183,12 +185,6 @@ pub struct LapseConfSchema11 {
other: HashMap<String, Value>, other: HashMap<String, Value>,
} }
impl Default for LeechAction {
fn default() -> Self {
LeechAction::TagOnly
}
}
impl Default for RevConfSchema11 { impl Default for RevConfSchema11 {
fn default() -> Self { fn default() -> Self {
RevConfSchema11 { RevConfSchema11 {

View file

@ -155,7 +155,6 @@ impl ColumnContext {
) -> Result<Vec<ForeignNote>> { ) -> Result<Vec<ForeignNote>> {
reader reader
.records() .records()
.into_iter()
.map(|res| { .map(|res| {
res.or_invalid("invalid csv") res.or_invalid("invalid csv")
.map(|record| self.foreign_note_from_record(&record)) .map(|record| self.foreign_note_from_record(&record))

View file

@ -302,7 +302,6 @@ fn collect_preview_records(
let mut csv_reader = build_csv_reader(reader, metadata.delimiter())?; let mut csv_reader = build_csv_reader(reader, metadata.delimiter())?;
csv_reader csv_reader
.records() .records()
.into_iter()
.take(PREVIEW_LENGTH) .take(PREVIEW_LENGTH)
.collect::<csv::Result<_>>() .collect::<csv::Result<_>>()
.or_invalid("invalid csv") .or_invalid("invalid csv")

View file

@ -60,7 +60,9 @@ pub struct RevlogEntry {
#[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, TryFromPrimitive, Clone, Copy)] #[derive(Serialize_repr, Deserialize_repr, Debug, PartialEq, Eq, TryFromPrimitive, Clone, Copy)]
#[repr(u8)] #[repr(u8)]
#[derive(Default)]
pub enum RevlogReviewKind { pub enum RevlogReviewKind {
#[default]
Learning = 0, Learning = 0,
Review = 1, Review = 1,
Relearning = 2, Relearning = 2,
@ -71,12 +73,6 @@ pub enum RevlogReviewKind {
Manual = 4, Manual = 4,
} }
impl Default for RevlogReviewKind {
fn default() -> Self {
RevlogReviewKind::Learning
}
}
impl RevlogEntry { impl RevlogEntry {
pub(crate) fn interval_secs(&self) -> u32 { pub(crate) fn interval_secs(&self) -> u32 {
u32::try_from(if self.interval > 0 { u32::try_from(if self.interval > 0 {

View file

@ -597,7 +597,7 @@ fn parse_mid(s: &str) -> ParseResult<SearchNode> {
/// ensure a list of ids contains only numbers and commas, returning unchanged /// ensure a list of ids contains only numbers and commas, returning unchanged
/// if true used by nid: and cid: /// 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! { lazy_static! {
static ref RE: Regex = Regex::new(r"^(\d+,)*\d+$").unwrap(); static ref RE: Regex = Regex::new(r"^(\d+,)*\d+$").unwrap();
} }

View file

@ -7,19 +7,14 @@ use crate::sync::collection::protocol::SyncProtocol;
use crate::sync::http_client::HttpSyncClient; use crate::sync::http_client::HttpSyncClient;
use crate::sync::login::SyncAuth; use crate::sync::login::SyncAuth;
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum SyncStage { pub enum SyncStage {
#[default]
Connecting, Connecting,
Syncing, Syncing,
Finalizing, Finalizing,
} }
impl Default for SyncStage {
fn default() -> Self {
SyncStage::Connecting
}
}
#[derive(Debug, Default, Clone, Copy)] #[derive(Debug, Default, Clone, Copy)]
pub struct FullSyncProgress { pub struct FullSyncProgress {
pub transferred_bytes: usize, pub transferred_bytes: usize,

View file

@ -63,9 +63,9 @@ pub(crate) fn apply_filters<'a>(
/// ///
/// Returns true if filter was valid. /// Returns true if filter was valid.
/// Returns string if input text changed. /// Returns string if input text changed.
fn apply_filter<'a>( fn apply_filter(
filter_name: &str, filter_name: &str,
text: &'a str, text: &str,
field_name: &str, field_name: &str,
context: &RenderContext, context: &RenderContext,
) -> (bool, Option<String>) { ) -> (bool, Option<String>) {

View file

@ -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.66.1" channel = "1.68.2"