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

Commit

Permalink
More clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Sep 15, 2022
1 parent d8d2121 commit 890dc68
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/rome_formatter/src/comments/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ impl<'a> SourceParentheses<'a> {
SourceParentheses::Empty => None,
SourceParentheses::SourceMap { next, tail, .. } => {
while let Some(range) = next {
#[allow(clippy::comparison-chain)]
if range.transformed == offset {
// A deleted range can contain multiple tokens. See if there's any `)` in the deleted
// range and compute its source range.
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_formatter/src/comments/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<K: std::hash::Hash + Eq, V> CommentsMap<K, V> {
#[cold]
fn entry_to_out_of_order<'a>(
entry: &'a mut Entry,
values: &Vec<V>,
values: &[V],
out_of_order: &mut Vec<Vec<V>>,
) -> &'a mut OutOfOrderEntry
where
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_formatter/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ where
}

let skipped_range =
skipped_range.unwrap_or(TextRange::empty(self.token.text_range().start()));
skipped_range.unwrap_or_else(|| TextRange::empty(self.token.text_range().start()));

let verbatim = {
let mut buffer = VecBuffer::new(f.state_mut());
Expand Down
2 changes: 2 additions & 0 deletions crates/rome_service/src/workspace_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fn instance_type<'a>(
if let Some(description) = description {
let comment = format!("/**\n\t* {} \n\t */", description);
let trivia = vec![
(TriviaPieceKind::Newline, "\n"),
(TriviaPieceKind::MultiLineComment, comment.as_str()),
(TriviaPieceKind::Newline, "\n"),
];
Expand Down Expand Up @@ -326,6 +327,7 @@ pub fn generate_type<'a>(
if let Some(description) = description {
let comment = format!("/**\n\t* {} \n\t */", description);
let trivia = vec![
(TriviaPieceKind::Newline, "\n"),
(TriviaPieceKind::MultiLineComment, comment.as_str()),
(TriviaPieceKind::Newline, "\n"),
];
Expand Down
1 change: 1 addition & 0 deletions xtask/codegen/src/generate_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub(crate) fn generate_workspace_bindings(mode: Mode) -> Result<()> {
if let Some(description) = description {
let comment = format!("/**\n\t* {} \n\t */\n", description);
let trivia = vec![
(TriviaPieceKind::Newline, "\n"),
(TriviaPieceKind::MultiLineComment, comment.as_str()),
(TriviaPieceKind::Newline, "\n"),
];
Expand Down

0 comments on commit 890dc68

Please sign in to comment.