Skip to content

useless change of signature #407

@thi8v

Description

@thi8v

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions