Skip to content

Commit

Permalink
refactor(error): fix warnings by 'cargo clippy' for error (#1002)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Kumar <[email protected]>
  • Loading branch information
octonawish-akcodes authored Jan 24, 2024
1 parent ffcc5d9 commit 6147b90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kclvm/error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl From<PanicInfo> for Diagnostic {
};
Diagnostic::new_with_code(
Level::Error,
&panic_msg,
panic_msg,
None,
(pos.clone(), pos),
None,
Expand All @@ -280,7 +280,7 @@ impl From<PanicInfo> for Diagnostic {
if frame.col != 0 {
backtrace_msg.push_str(&format!(":{}", frame.col))
}
backtrace_msg.push_str("\n")
backtrace_msg.push('\n')
}
let pos = Position {
filename: panic_info.kcl_file.clone(),
Expand All @@ -289,7 +289,7 @@ impl From<PanicInfo> for Diagnostic {
};
Diagnostic::new_with_code(
Level::Error,
&panic_msg,
panic_msg,
Some(&backtrace_msg),
(pos.clone(), pos),
None,
Expand Down Expand Up @@ -429,7 +429,7 @@ impl SessionDiagnostic for Diagnostic {
diag.append_component(Box::new(format!(": {}\n", warning.name())));
}
DiagnosticId::Suggestions => {
diag.append_component(Box::new(SuggestionsLabel::default()));
diag.append_component(Box::new(SuggestionsLabel));
}
},
None => match self.level {
Expand All @@ -443,7 +443,7 @@ impl SessionDiagnostic for Diagnostic {
diag.append_component(Box::new(Label::Note));
}
Level::Suggestions => {
diag.append_component(Box::new(SuggestionsLabel::default()));
diag.append_component(Box::new(SuggestionsLabel));
}
},
}
Expand Down

0 comments on commit 6147b90

Please sign in to comment.