Skip to content

Commit

Permalink
Rust 1.73.0 (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen authored Oct 6, 2023
1 parent b46f34e commit 5045853
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/jest_ast_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
11 changes: 7 additions & 4 deletions crates/oxc_linter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ impl Linter {
}

pub fn print_rules<W: Write>(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<RuleCategory, Vec<&RuleEnum>>, rule| {
map.entry(rule.category()).or_default().push(rule);
map
},
);

for (category, rules) in rules_by_category {
writeln!(writer, "{} ({}):", category, rules.len()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl LintOptions {

let mut rules = rules.into_iter().collect::<Vec<_>>();
// for stable diagnostics output ordering
rules.sort_unstable_by_key(|rule| rule.name());
rules.sort_unstable_by_key(RuleEnum::name);
rules
}
}
4 changes: 2 additions & 2 deletions crates/oxc_parser/src/js/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
}

Expand Down Expand Up @@ -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() }
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.72.0"
channel = "1.73.0"
profile = "default"

0 comments on commit 5045853

Please sign in to comment.