diff --git a/crates/rome_diagnostics/src/display/diff.rs b/crates/rome_diagnostics/src/display/diff.rs index ce8c514afc1..3e6be7a1077 100644 --- a/crates/rome_diagnostics/src/display/diff.rs +++ b/crates/rome_diagnostics/src/display/diff.rs @@ -110,9 +110,9 @@ pub(super) fn print_diff(fmt: &mut fmt::Formatter<'_>, diff: &TextEdit) -> io::R /// to line numbers in the new revision /// - `after_line` counts the number of lines in the new revision of the document /// - `before_line` counts the number of lines in the old revision of the document -fn process_diff_ops<'a, 'diff>( +fn process_diff_ops<'diff>( diff: &'diff TextEdit, - mut state: PushToLineState<'a, 'diff>, + mut state: PushToLineState<'_, 'diff>, after_line: &mut OneIndexed, before_line: &mut OneIndexed, ) { @@ -235,8 +235,8 @@ struct PushToLineState<'a, 'b> { before_line_to_after: &'a mut BTreeMap, } -fn push_to_line<'a, 'b>( - state: &mut PushToLineState<'a, 'b>, +fn push_to_line<'b>( + state: &mut PushToLineState<'_, 'b>, before_line: OneIndexed, after_line: OneIndexed, tag: ChangeTag, diff --git a/crates/rome_fs/src/fs/os.rs b/crates/rome_fs/src/fs/os.rs index 391dc5ff1c0..ccef99e1a1c 100644 --- a/crates/rome_fs/src/fs/os.rs +++ b/crates/rome_fs/src/fs/os.rs @@ -11,7 +11,7 @@ use std::fs::DirEntry; use std::{ ffi::OsStr, fs, - io::{self, ErrorKind as IoErrorKind, Read, Seek, SeekFrom, Write}, + io::{self, ErrorKind as IoErrorKind, Read, Seek, Write}, mem, path::{Path, PathBuf}, }; @@ -45,7 +45,7 @@ impl File for OsFile { fn read_to_string(&mut self, buffer: &mut String) -> io::Result<()> { tracing::debug_span!("OsFile::read_to_string").in_scope(move || { // Reset the cursor to the starting position - self.inner.seek(SeekFrom::Start(0))?; + self.inner.rewind()?; // Read the file content self.inner.read_to_string(buffer)?; Ok(()) @@ -57,7 +57,7 @@ impl File for OsFile { // Truncate the file self.inner.set_len(0)?; // Reset the cursor to the starting position - self.inner.seek(SeekFrom::Start(0))?; + self.inner.rewind()?; // Write the byte slice self.inner.write_all(content)?; Ok(())