diff --git a/build/ninja_gen/src/python.rs b/build/ninja_gen/src/python.rs index d3e04845c..1e770741c 100644 --- a/build/ninja_gen/src/python.rs +++ b/build/ninja_gen/src/python.rs @@ -190,7 +190,7 @@ impl BuildAction for PythonFormat<'_> { pub fn python_format(build: &mut Build, group: &str, inputs: BuildInput) -> Result<()> { let isort_ini = &inputs![".isort.cfg"]; build.add_action( - &format!("check:format:python:{group}"), + format!("check:format:python:{group}"), PythonFormat { inputs: &inputs, check_only: true, @@ -199,7 +199,7 @@ pub fn python_format(build: &mut Build, group: &str, inputs: BuildInput) -> Resu )?; build.add_action( - &format!("format:python:{group}"), + format!("format:python:{group}"), PythonFormat { inputs: &inputs, check_only: false, diff --git a/build/runner/src/bundle/binary.rs b/build/runner/src/bundle/binary.rs index 995587c0c..e9119220a 100644 --- a/build/runner/src/bundle/binary.rs +++ b/build/runner/src/bundle/binary.rs @@ -46,7 +46,7 @@ pub fn build_bundle_binary() { .join("Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic"); if ld_classic.exists() { // work around XCode 15's default linker not supporting macOS 10.15-12. - command.env("RUSTFLAGS", &format!("-Clink-arg=-fuse-ld={ld_classic}")); + command.env("RUSTFLAGS", format!("-Clink-arg=-fuse-ld={ld_classic}")); } } run_command(&mut command); diff --git a/rslib/i18n/src/lib.rs b/rslib/i18n/src/lib.rs index 7c78cf71c..1d79198bf 100644 --- a/rslib/i18n/src/lib.rs +++ b/rslib/i18n/src/lib.rs @@ -464,7 +464,7 @@ pub struct ResourcesForJavascript { } pub fn without_unicode_isolation(s: &str) -> String { - s.replace(|c| c == '\u{2068}' || c == '\u{2069}', "") + s.replace(['\u{2068}', '\u{2069}'], "") } #[cfg(test)] diff --git a/rslib/src/browser_table.rs b/rslib/src/browser_table.rs index 830f1b54a..be4e6393e 100644 --- a/rslib/src/browser_table.rs +++ b/rslib/src/browser_table.rs @@ -131,8 +131,7 @@ impl Card { } else { self.due_time(timing).map(|due| { due.adding_secs(-86_400 * self.interval as i64) - .elapsed_secs() - .max(0) as u32 + .elapsed_secs() as u32 / 86_400 }) } diff --git a/rslib/src/dbcheck.rs b/rslib/src/dbcheck.rs index fa66d2b9e..ae960ab5c 100644 --- a/rslib/src/dbcheck.rs +++ b/rslib/src/dbcheck.rs @@ -394,7 +394,7 @@ impl Collection { let qfmt = basic.templates[0].config.q_format.clone(); let afmt = basic.templates[0].config.a_format.clone(); for n in 0..extra_cards_required { - basic.add_template(&format!("Card {}", n + 2), &qfmt, &afmt); + basic.add_template(format!("Card {}", n + 2), &qfmt, &afmt); } self.add_notetype(&mut basic, true)?; Ok(Arc::new(basic)) diff --git a/rslib/src/sync/http_server/mod.rs b/rslib/src/sync/http_server/mod.rs index 7759f3383..f96209df7 100644 --- a/rslib/src/sync/http_server/mod.rs +++ b/rslib/src/sync/http_server/mod.rs @@ -223,7 +223,7 @@ impl SimpleServer { let config = envy::prefixed("SYNC_") .from_env::() .unwrap(); - std::net::TcpStream::connect(&format!("{}:{}", config.host, config.port)).is_ok() + std::net::TcpStream::connect(format!("{}:{}", config.host, config.port)).is_ok() } pub fn new(base_folder: &Path) -> error::Result { let inner = SimpleServerInner::new_from_env(base_folder)?; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1ccbe9f82..3c1f3ff7a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] # older versions may fail to compile; newer versions may fail the clippy tests -channel = "1.80.1" +channel = "1.81.0"