Hello,
as a user of codespan-reporting i have an issue with the new 0.13.0 version, I don't understand why the signature of the with_note method of Diagnostic now expects note: &impl ToString instead of note: impl ToString.
|
pub fn with_note(mut self, note: &impl ToString) -> Diagnostic<FileId> { |
I think it's less convenient because we can no longer do the following:
Diagnostic::error()
.with_note(format!("...", ...))
we need to add a borrow in front like .with_note(&format!("...", ...). But that's not all
the following code now outputs an error
Diagnostic::error()
.with_note("a string literal here, so has a &str type")
It now makes rust output the E0277 error, "the size for values of type str cannot be known at compilation time", and i think it's a major drawback, forcing the users of this library to borrow the string literal and i think it's too verbose.
Even though I'm complaining about this change in this issue, I thank you for this library, which is still very good. I'm open to any discussion if you want.
Sincerely,
Hello,
as a user of
codespan-reportingi have an issue with the new0.13.0version, I don't understand why the signature of thewith_notemethod ofDiagnosticnow expectsnote: &impl ToStringinstead ofnote: impl ToString.codespan/codespan-reporting/src/diagnostic.rs
Line 206 in e3b1ea8
I think it's less convenient because we can no longer do the following:
we need to add a borrow in front like
.with_note(&format!("...", ...). But that's not allthe following code now outputs an error
It now makes rust output the
E0277error, "the size for values of typestrcannot be known at compilation time", and i think it's a major drawback, forcing the users of this library to borrow the string literal and i think it's too verbose.Even though I'm complaining about this change in this issue, I thank you for this library, which is still very good. I'm open to any discussion if you want.
Sincerely,