diff --git a/Cargo.toml b/Cargo.toml index 672a0683a75db..59f52a41c8c63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ imperative = { version = "1.0.4" } indexmap = { version = "2.2.6" } indicatif = { version = "0.17.8" } indoc = { version = "2.0.4" } -insta = { version = "1.35.1", feature = ["filters", "glob"] } +insta = { version = "1.35.1" } insta-cmd = { version = "0.6.0" } is-macro = { version = "0.3.5" } is-wsl = { version = "0.4.0" } diff --git a/crates/red_knot/src/module.rs b/crates/red_knot/src/module.rs index 9050aaebbf112..820648b08451b 100644 --- a/crates/red_knot/src/module.rs +++ b/crates/red_knot/src/module.rs @@ -932,7 +932,7 @@ mod tests { // Luckily this crate will fail to build if this file isn't available at build time. const TYPESHED_ZIP_BYTES: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/zipped_typeshed.zip")); - assert!(!TYPESHED_ZIP_BYTES.is_empty()); + let mut typeshed_zip_archive = ZipArchive::new(Cursor::new(TYPESHED_ZIP_BYTES))?; let path_to_functools = Path::new("stdlib").join("functools.pyi"); diff --git a/crates/ruff_linter/src/registry/rule_set.rs b/crates/ruff_linter/src/registry/rule_set.rs index 7889ed81b5977..103906118af3a 100644 --- a/crates/ruff_linter/src/registry/rule_set.rs +++ b/crates/ruff_linter/src/registry/rule_set.rs @@ -1,8 +1,10 @@ -use crate::registry::Rule; -use ruff_macros::CacheKey; use std::fmt::{Debug, Display, Formatter}; use std::iter::FusedIterator; +use ruff_macros::CacheKey; + +use crate::registry::Rule; + const RULESET_SIZE: usize = 14; /// A set of [`Rule`]s. @@ -367,7 +369,7 @@ impl Iterator for RuleSetIterator { let rule_value = self.index * RuleSet::SLICE_BITS + bit; // SAFETY: RuleSet guarantees that only valid rules are stored in the set. #[allow(unsafe_code)] - return Some(unsafe { std::mem::transmute(rule_value) }); + return Some(unsafe { std::mem::transmute::(rule_value) }); } self.index += 1; @@ -387,9 +389,10 @@ impl FusedIterator for RuleSetIterator {} #[cfg(test)] mod tests { - use crate::registry::{Rule, RuleSet}; use strum::IntoEnumIterator; + use crate::registry::{Rule, RuleSet}; + /// Tests that the set can contain all rules #[test] fn test_all_rules() { diff --git a/crates/ruff_python_formatter/src/other/parameters.rs b/crates/ruff_python_formatter/src/other/parameters.rs index 6368e86f4e389..7515ede0a0cc2 100644 --- a/crates/ruff_python_formatter/src/other/parameters.rs +++ b/crates/ruff_python_formatter/src/other/parameters.rs @@ -1,5 +1,3 @@ -use std::usize; - use ruff_formatter::{format_args, write, FormatRuleWithOptions}; use ruff_python_ast::Parameters; use ruff_python_ast::{AnyNodeRef, AstNode}; diff --git a/crates/ruff_text_size/src/size.rs b/crates/ruff_text_size/src/size.rs index e6d9a2dcbe1f9..1b597698d3f26 100644 --- a/crates/ruff_text_size/src/size.rs +++ b/crates/ruff_text_size/src/size.rs @@ -5,7 +5,6 @@ use { fmt, iter, num::TryFromIntError, ops::{Add, AddAssign, Sub, SubAssign}, - u32, }, }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 744175d523f9a..c6e4d7d5031fa 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.78" +channel = "1.79"