Skip to content

Commit 88a898d

Browse files
ematipicoarendjrConaclos
authored
chore: upgrade to rust 1.87.0 (#6168)
Co-authored-by: arendjr <[email protected]> Co-authored-by: Conaclos <[email protected]>
1 parent 762516c commit 88a898d

File tree

28 files changed

+207
-94
lines changed

28 files changed

+207
-94
lines changed

crates/biome_aria_metadata/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl AriaValueType {
105105
Self::Number => value.parse::<f32>().is_ok(),
106106
Self::Boolean => matches!(value, "false" | "true"),
107107
Self::OptionalBoolean => matches!(value, "undefined" | "false" | "true"),
108-
Self::Token(tokens) => tokens.iter().any(|allowed_token| *allowed_token == value),
108+
Self::Token(tokens) => tokens.contains(&value),
109109
Self::TokenList(tokens) => value.split_ascii_whitespace().all(|input_token| {
110110
tokens
111111
.iter()

crates/biome_cli/src/execute/migrate/ignorefile.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(crate) fn convert_pattern(line: &str) -> String {
5050
} else {
5151
("!", line)
5252
};
53-
let result = if let Some(stripped_line) = line.strip_prefix('/') {
53+
if let Some(stripped_line) = line.strip_prefix('/') {
5454
// Patterns that starts with `/` are relative to the ignore file
5555
format!("{negation}./{stripped_line}")
5656
} else if line.find('/').is_some_and(|index| index < (line.len() - 1))
@@ -61,8 +61,7 @@ pub(crate) fn convert_pattern(line: &str) -> String {
6161
format!("{negation}{line}")
6262
} else {
6363
format!("{negation}**/{line}")
64-
};
65-
result
64+
}
6665
}
6766

6867
#[cfg(test)]

crates/biome_cli/src/execute/traverse.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ impl TraversalContext for TraversalOptions<'_, '_> {
611611
return false;
612612
}
613613
};
614-
let result = match self.execution.traversal_mode() {
614+
match self.execution.traversal_mode() {
615615
TraversalMode::Check { .. } | TraversalMode::CI { .. } => {
616616
file_features.supports_lint()
617617
|| file_features.supports_format()
@@ -622,8 +622,7 @@ impl TraversalContext for TraversalOptions<'_, '_> {
622622
// Imagine if Biome can't handle its own configuration file...
623623
TraversalMode::Migrate { .. } => true,
624624
TraversalMode::Search { .. } => file_features.supports_search(),
625-
};
626-
result
625+
}
627626
}
628627

629628
fn handle_path(&self, path: BiomePath) {

crates/biome_cli/src/service/unix.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,7 @@ pub(crate) async fn ensure_daemon(
175175

176176
// If the connection couldn't be opened after 10 tries fail with the last
177177
// error message from the OS, or a generic error message otherwise
178-
Err(last_error.unwrap_or_else(|| {
179-
io::Error::new(
180-
io::ErrorKind::Other,
181-
"could not connect to the daemon socket",
182-
)
183-
}))
178+
Err(last_error.unwrap_or_else(|| io::Error::other("could not connect to the daemon socket")))
184179
}
185180

186181
/// Ensure the server daemon is running and ready to receive connections and

crates/biome_console/src/write/termcolor.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ where
5353
if adapter.error.is_err() {
5454
adapter.error
5555
} else {
56-
Err(io::Error::new(
57-
io::ErrorKind::Other,
58-
"a Display formatter returned an error",
59-
))
56+
Err(io::Error::other("a Display formatter returned an error"))
6057
}
6158
}
6259
}

crates/biome_css_parser/src/lexer/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,14 @@ impl<'src> CssLexer<'src> {
257257
.get_unchecked((self.position + offset)..),
258258
)
259259
};
260-
let chr = if let Some(chr) = string.chars().next() {
260+
if let Some(chr) = string.chars().next() {
261261
chr
262262
} else {
263263
// Safety: we always call this when we are at a valid char, so this branch is completely unreachable
264264
unsafe {
265265
core::hint::unreachable_unchecked();
266266
}
267-
};
268-
269-
chr
267+
}
270268
}
271269

272270
/// Check if the lexer is at a valid escape. U+005C REVERSE SOLIDUS (\)

crates/biome_deserialize_macros/src/partial_derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub(crate) fn generate_partial(input: DeriveInput) -> TokenStream {
108108
});
109109

110110
let ty = match attrs.ty.as_ref() {
111-
Some(PartialType::Literal(ty)) => ty.clone(),
111+
Some(PartialType::Literal(ty)) => ty.as_ref().clone(),
112112
Some(PartialType::Prefixed) => {
113113
let mut ty = ty.clone();
114114
if let Type::Path(type_path) = &mut ty {

crates/biome_deserialize_macros/src/partial_derive/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,5 @@ impl TryFrom<&Vec<Attribute>> for FieldAttrs {
100100
pub enum PartialType {
101101
#[default]
102102
Prefixed,
103-
Literal(Type),
103+
Literal(Box<Type>),
104104
}

crates/biome_diagnostics/src/context.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,19 +344,15 @@ mod internal {
344344

345345
impl fmt::Write for DisplayMarkup<'_, '_> {
346346
fn write_str(&mut self, _: &fmt::MarkupElements<'_>, content: &str) -> io::Result<()> {
347-
self.0
348-
.write_str(content)
349-
.map_err(|error| io::Error::new(io::ErrorKind::Other, error))
347+
self.0.write_str(content).map_err(io::Error::other)
350348
}
351349

352350
fn write_fmt(
353351
&mut self,
354352
_: &fmt::MarkupElements<'_>,
355353
content: std::fmt::Arguments<'_>,
356354
) -> io::Result<()> {
357-
self.0
358-
.write_fmt(content)
359-
.map_err(|error| io::Error::new(io::ErrorKind::Other, error))
355+
self.0.write_fmt(content).map_err(io::Error::other)
360356
}
361357
}
362358

crates/biome_diagnostics_macros/src/generate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::parse::{
88

99
pub(crate) fn generate_diagnostic(input: DeriveInput) -> TokenStream {
1010
match input {
11-
DeriveInput::DeriveStructInput(input) => generate_struct_diagnostic(input),
12-
DeriveInput::DeriveEnumInput(input) => generate_enum_diagnostic(input),
11+
DeriveInput::DeriveStructInput(input) => generate_struct_diagnostic(*input),
12+
DeriveInput::DeriveEnumInput(input) => generate_enum_diagnostic(*input),
1313
}
1414
}
1515

0 commit comments

Comments
 (0)