Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(error): fix warnings by 'cargo clippy' for error #1002

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
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
Loading