Skip to main content

Fixable

Trait Fixable 

Source
pub trait Fixable: Warning + Sealed {
    // Required method
    fn fix(&self, element: &Element<'_>) -> Option<Edit>;
}
Expand description

A Warning that a mechanical edit can resolve.

An implementation reports what edit would resolve the warning, not whether the edit should be made. Whether a given fix is wanted is the caller’s decision, so a caller that does not want one filters the warning out of the set before calling edits.

Sealed, because only this crate can build an Edit: an implementation outside it could return nothing but None.

Required Methods§

Source

fn fix(&self, element: &Element<'_>) -> Option<Edit>

The edit that resolves this warning at element, or None if nothing mechanical can resolve it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Fixable for ocpi_tariffs::schema::Warning

Source§

impl Fixable for ocpi_tariffs::lint::tariff::Warning