Skip to content

Commit

Permalink
chore: upgrade Rust to 1.73.0 (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Oct 10, 2023
1 parent 1e3fc94 commit c017179
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crates/biome_aria/src/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub trait AriaRoleDefinition: Debug {

/// Returns a concrete type name.
fn type_name(&self) -> &'static str {
return std::any::type_name::<Self>();
std::any::type_name::<Self>()
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl BufferSnapshot {
Err(err) => {
panic!(
"Tried to unwrap snapshot of type {:?} as {:?}",
err.type_id(),
(*err).type_id(),
TypeId::of::<T>()
)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/comments/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ where
fn enclosing_node(&self) -> &SyntaxNode<Style::Language> {
let element = match self.following_node_index {
None => self.parents.last(),
Some(index) if index == 0 => Some(&self.parents[0]),
Some(0) => Some(&self.parents[0]),
Some(index) => Some(&self.parents[index - 1]),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl Rule for UseBlockStatements {
.first_leading_trivia()
.as_ref()
.map(collect_to_first_newline)
.unwrap_or_else(Vec::new);
.unwrap_or_default();

// If the statement has no leading trivia, add a space after
// the opening curly token
Expand Down Expand Up @@ -203,7 +203,7 @@ impl Rule for UseBlockStatements {
.first_leading_trivia()
.as_ref()
.map(collect_to_first_newline)
.unwrap_or_else(Vec::new);
.unwrap_or_default();
}

// Apply the cloned trivia to the closing curly token, or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ impl FormatNodeRule<TsInterfaceDeclaration> for FormatTsInterfaceDeclaration {
let l_curly_token = l_curly_token?;
let r_curly_token = r_curly_token?;
let id = id?;
let type_parameters = type_parameters;

let should_indent_extends_only = type_parameters.as_ref().map_or(false, |params| {
!f.comments().has_trailing_line_comment(params.syntax())
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy.
# https://rust-lang.github.io/rustup/concepts/profiles.html
profile = "default"
channel = "1.72.0"
channel = "1.73.0"
1 change: 0 additions & 1 deletion xtask/codegen/src/kinds_src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ impl Field {
format_ident!("{}_token", name)
}
Field::Node { name, .. } => {
let name = name;
let (prefix, tail) = name.split_once('_').unwrap_or(("", name));
let final_name = if LANGUAGE_PREFIXES.contains(&prefix) {
tail
Expand Down
2 changes: 1 addition & 1 deletion xtask/coverage/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn coverage_compare(
let mut new_results = read_test_results(new_result_dir.as_path(), "new");

for (suite, base) in base_results {
let new_result = new_results.remove(&suite).unwrap_or_else(TestResults::new);
let new_result = new_results.remove(&suite).unwrap_or_default();

emit_compare(&base, &new_result, suite.as_str(), markdown);
}
Expand Down
10 changes: 6 additions & 4 deletions xtask/lintdoc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn main() -> Result<()> {
self.number_or_rules += 1;
self.groups
.entry(<R::Group as RuleGroup>::NAME)
.or_insert_with(BTreeMap::new)
.or_default()
.insert(R::METADATA.name, R::METADATA);
}
}
Expand All @@ -120,7 +120,7 @@ fn main() -> Result<()> {
self.number_or_rules += 1;
self.groups
.entry(<R::Group as RuleGroup>::NAME)
.or_insert_with(BTreeMap::new)
.or_default()
.insert(R::METADATA.name, R::METADATA);
}
}
Expand Down Expand Up @@ -170,8 +170,10 @@ fn main() -> Result<()> {
"failed to generate documentation pages for the following rules:\n{}",
errors
.into_iter()
.map(|(rule, err)| format!("- {rule}: {err:?}\n"))
.collect::<String>()
.fold(String::new(), |mut s, (rule, err)| {
s.push_str(&format!("- {rule}: {err:?}\n"));
s
})
);
}
let recommended_rules_buffer = format!(
Expand Down

0 comments on commit c017179

Please sign in to comment.