Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
ci: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Feb 25, 2023
1 parent 9254260 commit d558b49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions crates/rome_diagnostics/src/display/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
Expand Down Expand Up @@ -235,8 +235,8 @@ struct PushToLineState<'a, 'b> {
before_line_to_after: &'a mut BTreeMap<OneIndexed, OneIndexed>,
}

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,
Expand Down
6 changes: 3 additions & 3 deletions crates/rome_fs/src/fs/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};
Expand Down Expand Up @@ -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(())
Expand All @@ -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(())
Expand Down

0 comments on commit d558b49

Please sign in to comment.