lint: port non-fmt-panic diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
48e4bf115f
commit
7ee4aa7003
5 changed files with 132 additions and 91 deletions
|
@ -39,6 +39,16 @@ pub trait IntoDiagnosticArg {
|
|||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static>;
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for bool {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
if self {
|
||||
DiagnosticArgValue::Str(Cow::Borrowed("true"))
|
||||
} else {
|
||||
DiagnosticArgValue::Str(Cow::Borrowed("false"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for String {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
DiagnosticArgValue::Str(Cow::Owned(self))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue