diff --git a/crates/oxc_linter/src/jest_ast_util.rs b/crates/oxc_linter/src/jest_ast_util.rs index 054e6e2482dc5..85a5647fd85ef 100644 --- a/crates/oxc_linter/src/jest_ast_util.rs +++ b/crates/oxc_linter/src/jest_ast_util.rs @@ -541,7 +541,7 @@ impl<'a> MemberExpressionElement<'a> { pub fn from_member_expr( member_expr: &'a MemberExpression<'a>, ) -> Option<(Span, MemberExpressionElement<'a>)> { - let Some((span, _)) = member_expr.static_property_info() else { return None }; + let (span, _) = member_expr.static_property_info()?; match member_expr { MemberExpression::ComputedMemberExpression(expr) => { Some((span, Self::Expression(&expr.expression))) diff --git a/crates/oxc_linter/src/lib.rs b/crates/oxc_linter/src/lib.rs index 6a28963228046..3fc75db5583f0 100644 --- a/crates/oxc_linter/src/lib.rs +++ b/crates/oxc_linter/src/lib.rs @@ -118,10 +118,13 @@ impl Linter { } pub fn print_rules(writer: &mut W) { - let rules_by_category = RULES.iter().fold(FxHashMap::default(), |mut map, rule| { - map.entry(rule.category()).or_insert_with(Vec::new).push(rule); - map - }); + let rules_by_category = RULES.iter().fold( + FxHashMap::default(), + |mut map: FxHashMap>, rule| { + map.entry(rule.category()).or_default().push(rule); + map + }, + ); for (category, rules) in rules_by_category { writeln!(writer, "{} ({}):", category, rules.len()).unwrap(); diff --git a/crates/oxc_linter/src/options.rs b/crates/oxc_linter/src/options.rs index cb981f7cd3fb6..15fb77ee2f8ad 100644 --- a/crates/oxc_linter/src/options.rs +++ b/crates/oxc_linter/src/options.rs @@ -111,7 +111,7 @@ impl LintOptions { let mut rules = rules.into_iter().collect::>(); // for stable diagnostics output ordering - rules.sort_unstable_by_key(|rule| rule.name()); + rules.sort_unstable_by_key(RuleEnum::name); rules } } diff --git a/crates/oxc_parser/src/js/list.rs b/crates/oxc_parser/src/js/list.rs index acf57bae3cad7..10ca57e37e4f9 100644 --- a/crates/oxc_parser/src/js/list.rs +++ b/crates/oxc_parser/src/js/list.rs @@ -395,7 +395,7 @@ pub struct ClassElements<'a> { } impl<'a> ClassElements<'a> { - pub(crate) fn new(p: &mut Parser<'a>) -> Self { + pub(crate) fn new(p: &Parser<'a>) -> Self { Self { elements: p.ast.new_vec(), private_bound_identifiers: FxHashMap::default() } } @@ -481,7 +481,7 @@ pub struct SwitchCases<'a> { } impl<'a> SwitchCases<'a> { - pub(crate) fn new(p: &mut Parser<'a>) -> Self { + pub(crate) fn new(p: &Parser<'a>) -> Self { Self { elements: p.ast.new_vec() } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 748be2713f5b3..4c42aeedfb19b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.72.0" +channel = "1.73.0" profile = "default"