Skip to content

access to &self in display() #6

Closed
@colin-kiegel

Description

@colin-kiegel

compile error: self is not available in a static method. Maybe a self argument is missing? [E0424]

I would like to reuse the error description in the Display::fmt function on some occasions. It would be nice to do this by delegation to self.description(). There might be addional usecases for &self access.

quick_error! {
    #[derive(Debug)]
    pub enum LoaderError {
        ArrayTemplateNotFound(name: String) {
            description("Template not found")
            display("{}: {:?}", self.description(), name)
        }
    }
}

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