Port DlltoolFailImportLibrary and implement IntoDiagnosticArg for Cow<'a, str>

This commit is contained in:
SLASHLogin 2022-08-26 19:01:22 +02:00
parent 81f7a8d7f1
commit c01546fcd6
4 changed files with 26 additions and 6 deletions

View file

@ -107,6 +107,12 @@ impl IntoDiagnosticArg for String {
}
}
impl<'a> IntoDiagnosticArg for Cow<'a, str> {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
DiagnosticArgValue::Str(Cow::Owned(self.into_owned()))
}
}
impl<'a> IntoDiagnosticArg for &'a Path {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
DiagnosticArgValue::Str(Cow::Owned(self.display().to_string()))