Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
container:
image: rust:1.88.0-bullseye@sha256:b315f988b86912bafa7afd39a6ded0a497bf850ec36578ca9a3bdd6a14d5db4e
image: rust:1.89.0-bullseye@sha256:6dd47db91f6637af2cb581979d1b01164826780591edba9859a6cb24b48da7b8

env:
version: ${{ needs.version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
container:
image: rust:1.88.0-bullseye@sha256:b315f988b86912bafa7afd39a6ded0a497bf850ec36578ca9a3bdd6a14d5db4e
image: rust:1.89.0-bullseye@sha256:6dd47db91f6637af2cb581979d1b01164826780591edba9859a6cb24b48da7b8

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
container:
image: rust:1.88.0-bullseye@sha256:b315f988b86912bafa7afd39a6ded0a497bf850ec36578ca9a3bdd6a14d5db4e
image: rust:1.89.0-bullseye@sha256:6dd47db91f6637af2cb581979d1b01164826780591edba9859a6cb24b48da7b8

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1@sha256:9857836c9ee4268391bb5b09f9f157f3c91bb15821bb77969642813b0d00518d
FROM rust:1.88.0@sha256:af306cfa71d987911a781c37b59d7d67d934f49684058f96cf72079c3626bfe0
FROM rust:1.89.0-bookworm@sha256:c50cd6e20c46b0b36730b5eb27289744e4bb8f32abc90d8c64ca09decf4f55ba
WORKDIR /usr/src/

# https://github.com/nodesource/distributions
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs
RUN cargo install hyperfine

COPY Cargo.toml Cargo.lock ./
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_analyze/src/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ mod tests {
fn parse_suppression_comment(
comment: &str,
_piece_range: TextRange,
) -> Vec<Result<AnalyzerSuppression, Infallible>> {
) -> Vec<Result<AnalyzerSuppression<'_>, Infallible>> {
comment
.trim_start_matches("//")
.split(' ')
Expand Down
11 changes: 0 additions & 11 deletions crates/biome_cli/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,6 @@ pub struct MigrationDiagnostic {
pub reason: String,
}

#[derive(Debug, Diagnostic)]
#[diagnostic(
category = "internalError/fs",
severity = Warning,
tags(DEPRECATED_CODE)
)]
pub struct DeprecatedArgument {
#[message]
pub message: MessageAndDescription,
}

#[derive(Debug, Diagnostic)]
pub enum ReportDiagnostic {
/// Emitted when trying to serialise the report
Expand Down
10 changes: 5 additions & 5 deletions crates/biome_control_flow/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<L: Language> FunctionBuilder<L> {
}

/// Insert an instruction at the current position of the cursor
fn append_instruction(&mut self, kind: InstructionKind) -> InstructionBuilder<L> {
fn append_instruction(&mut self, kind: InstructionKind) -> InstructionBuilder<'_, L> {
let index = self.block_cursor.index as usize;
let block = &mut self.result.blocks[index];

Expand All @@ -119,23 +119,23 @@ impl<L: Language> FunctionBuilder<L> {
InstructionBuilder(&mut block.instructions[index])
}

pub fn append_statement(&mut self) -> InstructionBuilder<L> {
pub fn append_statement(&mut self) -> InstructionBuilder<'_, L> {
self.append_instruction(InstructionKind::Statement)
}

pub fn append_return(&mut self) -> InstructionBuilder<L> {
pub fn append_return(&mut self) -> InstructionBuilder<'_, L> {
self.append_instruction(InstructionKind::Return)
}

pub fn append_jump(&mut self, conditional: bool, block: BlockId) -> InstructionBuilder<L> {
pub fn append_jump(&mut self, conditional: bool, block: BlockId) -> InstructionBuilder<'_, L> {
self.append_instruction(InstructionKind::Jump {
conditional,
block,
finally_fallthrough: false,
})
}

pub fn append_finally_fallthrough(&mut self, block: BlockId) -> InstructionBuilder<L> {
pub fn append_finally_fallthrough(&mut self, block: BlockId) -> InstructionBuilder<'_, L> {
self.append_instruction(InstructionKind::Jump {
conditional: false,
block,
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_css_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ where
fn parse_linter_suppression_comment(
text: &str,
piece_range: TextRange,
) -> Vec<Result<AnalyzerSuppression, SuppressionDiagnostic>> {
) -> Vec<Result<AnalyzerSuppression<'_>, SuppressionDiagnostic>> {
let mut result = Vec::new();

for suppression in parse_suppression_comment(text) {
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_css_formatter/src/trivia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) struct FormatRemoved<'a> {
token: &'a CssSyntaxToken,
}

pub(crate) fn format_removed(token: &CssSyntaxToken) -> FormatRemoved {
pub(crate) fn format_removed(token: &CssSyntaxToken) -> FormatRemoved<'_> {
FormatRemoved { token }
}

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_css_formatter/src/utils/string_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'token> FormatLiteralStringToken<'token> {
self.token
}

pub fn clean_text(&self, options: &CssFormatOptions) -> CleanedStringLiteralText {
pub fn clean_text(&self, options: &CssFormatOptions) -> CleanedStringLiteralText<'_> {
let token = self.token();
debug_assert!(
matches!(
Expand Down
6 changes: 3 additions & 3 deletions crates/biome_css_formatter/src/verbatim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use biome_rowan::{AstNode, Direction, SyntaxElement, TextRange};
///
/// These nodes and tokens get tracked as [VerbatimKind::Verbatim], useful to understand
/// if these nodes still need to have their own implementation.
pub fn format_css_verbatim_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode {
pub fn format_css_verbatim_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode<'_> {
FormatCssVerbatimNode {
node,
kind: VerbatimKind::Verbatim {
Expand Down Expand Up @@ -150,7 +150,7 @@ impl Format<CssFormatContext> for FormatCssVerbatimNode<'_> {

/// Formats bogus nodes. The difference between this method and `format_verbatim` is that this method
/// doesn't track nodes/tokens as [VerbatimKind::Verbatim]. They are just printed as they are.
pub fn format_bogus_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode {
pub fn format_bogus_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode<'_> {
FormatCssVerbatimNode {
node,
kind: VerbatimKind::Bogus,
Expand All @@ -159,7 +159,7 @@ pub fn format_bogus_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode {
}

/// Format a node having formatter suppression comment applied to it
pub fn format_suppressed_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode {
pub fn format_suppressed_node(node: &CssSyntaxNode) -> FormatCssVerbatimNode<'_> {
FormatCssVerbatimNode {
node,
kind: VerbatimKind::Suppressed,
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_formatter/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ impl<Context> Buffer for RemoveSoftLinesBuffer<'_, Context> {
pub trait BufferExtensions: Buffer + Sized {
/// Returns a new buffer that calls the passed inspector for every element that gets written to the output
#[must_use]
fn inspect<F>(&mut self, inspector: F) -> Inspect<Self::Context, F>
fn inspect<F>(&mut self, inspector: F) -> Inspect<'_, Self::Context, F>
where
F: FnMut(&FormatElement),
{
Expand Down Expand Up @@ -730,7 +730,7 @@ pub trait BufferExtensions: Buffer + Sized {
/// # }
/// ```
#[must_use]
fn start_recording(&mut self) -> Recording<Self> {
fn start_recording(&mut self) -> Recording<'_, Self> {
Recording::new(self)
}

Expand Down
41 changes: 24 additions & 17 deletions crates/biome_formatter/src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl std::fmt::Debug for StaticText {
}

/// Creates a text from a dynamic string and a range of the input source
pub fn dynamic_text(text: &str, position: TextSize) -> DynamicText {
pub fn dynamic_text(text: &str, position: TextSize) -> DynamicText<'_> {
debug_assert_no_newlines(text);

DynamicText { text, position }
Expand Down Expand Up @@ -420,7 +420,7 @@ fn debug_assert_no_newlines(text: &str) {
/// # }
/// ```
#[inline]
pub fn line_suffix<Content, Context>(inner: &Content) -> LineSuffix<Context>
pub fn line_suffix<Content, Context>(inner: &Content) -> LineSuffix<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -550,7 +550,10 @@ impl<Context> Format<Context> for LineSuffixBoundary {
/// Use `Memoized.inspect(f)?.has_label(LabelId::of(MyLabels::Main)` if you need to know if some content breaks that should
/// only be written later.
#[inline]
pub fn labelled<Content, Context>(label_id: LabelId, content: &Content) -> FormatLabelled<Context>
pub fn labelled<Content, Context>(
label_id: LabelId,
content: &Content,
) -> FormatLabelled<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -772,7 +775,7 @@ impl<Context> Format<Context> for HardSpace {
/// # }
/// ```
#[inline]
pub fn indent<Content, Context>(content: &Content) -> Indent<Context>
pub fn indent<Content, Context>(content: &Content) -> Indent<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -929,7 +932,7 @@ impl<Context> std::fmt::Debug for Indent<'_, Context> {
/// # }
/// ```
#[inline]
pub fn dedent<Content, Context>(content: &Content) -> Dedent<Context>
pub fn dedent<Content, Context>(content: &Content) -> Dedent<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -1002,7 +1005,7 @@ impl<Context> std::fmt::Debug for Dedent<'_, Context> {
///
/// This resembles the behaviour of Prettier's `align(Number.NEGATIVE_INFINITY, content)` IR element.
#[inline]
pub fn dedent_to_root<Content, Context>(content: &Content) -> Dedent<Context>
pub fn dedent_to_root<Content, Context>(content: &Content) -> Dedent<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -1115,7 +1118,7 @@ where
///
/// * tab indention: Printer indents the expression with two tabs because the `align` increases the indention level.
/// * space indention: Printer indents the expression by 4 spaces (one indention level) **and** 2 spaces for the align.
pub fn align<Content, Context>(count: u8, content: &Content) -> Align<Context>
pub fn align<Content, Context>(count: u8, content: &Content) -> Align<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -1183,7 +1186,7 @@ impl<Context> std::fmt::Debug for Align<'_, Context> {
/// # }
/// ```
#[inline]
pub fn block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<Context> {
pub fn block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<'_, Context> {
BlockIndent {
content: Argument::new(content),
mode: IndentMode::Block,
Expand Down Expand Up @@ -1254,7 +1257,7 @@ pub fn block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<Cont
/// # }
/// ```
#[inline]
pub fn soft_block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<Context> {
pub fn soft_block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<'_, Context> {
BlockIndent {
content: Argument::new(content),
mode: IndentMode::Soft,
Expand Down Expand Up @@ -1357,7 +1360,7 @@ pub fn soft_block_indent<Context>(content: &impl Format<Context>) -> BlockIndent
pub fn soft_block_indent_with_maybe_space<Context>(
content: &impl Format<Context>,
should_add_space: bool,
) -> BlockIndent<Context> {
) -> BlockIndent<'_, Context> {
if should_add_space {
soft_space_or_block_indent(content)
} else {
Expand Down Expand Up @@ -1432,7 +1435,9 @@ pub fn soft_block_indent_with_maybe_space<Context>(
/// # }
/// ```
#[inline]
pub fn soft_line_indent_or_space<Context>(content: &impl Format<Context>) -> BlockIndent<Context> {
pub fn soft_line_indent_or_space<Context>(
content: &impl Format<Context>,
) -> BlockIndent<'_, Context> {
BlockIndent {
content: Argument::new(content),
mode: IndentMode::SoftLineOrSpace,
Expand Down Expand Up @@ -1534,7 +1539,7 @@ pub fn soft_line_indent_or_space<Context>(content: &impl Format<Context>) -> Blo
#[inline]
pub fn soft_line_indent_or_hard_space<Context>(
content: &impl Format<Context>,
) -> BlockIndent<Context> {
) -> BlockIndent<'_, Context> {
BlockIndent {
content: Argument::new(content),
mode: IndentMode::HardSpace,
Expand Down Expand Up @@ -1670,7 +1675,9 @@ impl<Context> std::fmt::Debug for BlockIndent<'_, Context> {
/// # Ok(())
/// # }
/// ```
pub fn soft_space_or_block_indent<Context>(content: &impl Format<Context>) -> BlockIndent<Context> {
pub fn soft_space_or_block_indent<Context>(
content: &impl Format<Context>,
) -> BlockIndent<'_, Context> {
BlockIndent {
content: Argument::new(content),
mode: IndentMode::SoftSpace,
Expand Down Expand Up @@ -1750,7 +1757,7 @@ pub fn soft_space_or_block_indent<Context>(content: &impl Format<Context>) -> Bl
/// # }
/// ```
#[inline]
pub fn group<Context>(content: &impl Format<Context>) -> Group<Context> {
pub fn group<Context>(content: &impl Format<Context>) -> Group<'_, Context> {
Group {
content: Argument::new(content),
group_id: None,
Expand Down Expand Up @@ -1933,7 +1940,7 @@ impl<Context> Format<Context> for ExpandParent {
/// # }
/// ```
#[inline]
pub fn if_group_breaks<Content, Context>(content: &Content) -> IfGroupBreaks<Context>
pub fn if_group_breaks<Content, Context>(content: &Content) -> IfGroupBreaks<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -2014,7 +2021,7 @@ where
/// # }
/// ```
#[inline]
pub fn if_group_fits_on_line<Content, Context>(flat_content: &Content) -> IfGroupBreaks<Context>
pub fn if_group_fits_on_line<Content, Context>(flat_content: &Content) -> IfGroupBreaks<'_, Context>
where
Content: Format<Context>,
{
Expand Down Expand Up @@ -2200,7 +2207,7 @@ impl<Context> std::fmt::Debug for IfGroupBreaks<'_, Context> {
pub fn indent_if_group_breaks<Content, Context>(
content: &Content,
group_id: GroupId,
) -> IndentIfGroupBreaks<Context>
) -> IndentIfGroupBreaks<'_, Context>
where
Content: Format<Context>,
{
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/comments/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<K: std::hash::Hash + Eq, V> CommentsMap<K, V> {
}

/// Returns an iterator over all leading, dangling, and trailing parts of `key`.
pub fn parts(&self, key: &K) -> PartsIterator<V> {
pub fn parts(&self, key: &K) -> PartsIterator<'_, V> {
match self.index.get(key) {
None => PartsIterator::Slice([].iter()),
Some(entry) => PartsIterator::from_entry(entry, self),
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/format_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub const LINE_TERMINATORS: [char; 3] = ['\r', LINE_SEPARATOR, PARAGRAPH_SEPARAT

/// Replace the line terminators matching the provided list with "\n"
/// since its the only line break type supported by the printer
pub fn normalize_newlines<const N: usize>(text: &str, terminators: [char; N]) -> Cow<str> {
pub fn normalize_newlines<const N: usize>(text: &str, terminators: [char; N]) -> Cow<'_, str> {
let mut result = String::new();
let mut last_end = 0;

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/separated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
}

/// Formats a single element inside a separated list.
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone)]
pub struct FormatSeparatedElement<N, R, C>
where
N: AstNode,
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl TransformSourceMap {
}

/// Returns an iterator over all deleted ranges in increasing order by their start position.
pub fn deleted_ranges(&self) -> DeletedRanges {
pub fn deleted_ranges(&self) -> DeletedRanges<'_> {
DeletedRanges {
source_text: self.source(),
deleted_ranges: self.deleted_ranges.iter(),
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/token/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct FormatNumberLiteralExponent {
first_non_zero_index: Option<NonZeroUsize>,
}
// Regex-free version of https://github.com/prettier/prettier/blob/ca246afacee8e6d5db508dae01730c9523bbff1d/src/common/util.js#L341-L356
pub fn format_trimmed_number(text: &str, options: NumberFormatOptions) -> Cow<str> {
pub fn format_trimmed_number(text: &str, options: NumberFormatOptions) -> Cow<'_, str> {
use FormatNumberLiteralState::*;

let text = text.to_ascii_lowercase_cow();
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter/src/token/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn normalize_string(
raw_content: &str,
preferred_quote: Quote,
quotes_will_change: bool,
) -> Cow<str> {
) -> Cow<'_, str> {
let alternate_quote = preferred_quote.other().as_byte();
let preferred_quote = preferred_quote.as_byte();
let mut reduced_string = String::new();
Expand Down
Loading
Loading