mirror of
https://github.com/ankitects/anki.git
synced 2026-01-05 18:13:56 -05:00
Merge f873e68e31 into 8f2144534b
This commit is contained in:
commit
195cb02deb
3 changed files with 2 additions and 13 deletions
|
|
@ -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 serde::Deserialize;
|
||||
use serde_aux::field_attributes::deserialize_bool_from_anything;
|
||||
use strum::IntoStaticStr;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
|
@ -56,15 +54,6 @@ pub enum BoolKey {
|
|||
AddingDefaultsToCurrentDeck,
|
||||
}
|
||||
|
||||
/// This is a workaround for old clients that used ints to represent boolean
|
||||
/// values. For new config items, prefer using a bool directly.
|
||||
#[derive(Deserialize, Default)]
|
||||
struct BoolLike(
|
||||
#[serde(deserialize_with = "deserialize_bool_from_anything")]
|
||||
#[allow(dead_code)]
|
||||
bool,
|
||||
);
|
||||
|
||||
impl Collection {
|
||||
pub fn get_config_bool(&self, key: BoolKey) -> bool {
|
||||
match key {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ impl Collection {
|
|||
) -> Result<()> {
|
||||
let ease_factor = u32::from(
|
||||
card.memory_state
|
||||
.map(|s| ((s.difficulty_shifted() * 1000.) as u16))
|
||||
.map(|s| (s.difficulty_shifted() * 1000.) as u16)
|
||||
.unwrap_or(card.ease_factor),
|
||||
);
|
||||
let entry = RevlogEntry {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[toolchain]
|
||||
# older versions may fail to compile; newer versions may fail the clippy tests
|
||||
channel = "1.89.0"
|
||||
channel = "1.90.0"
|
||||
|
|
|
|||
Loading…
Reference in a new issue