[][src]Struct libslide::linter::stmt::redundant_nesting::RedundantNestingLinter

pub struct RedundantNestingLinter<'a> {
    source: &'a str,
    diagnostics: Vec<Diagnostic>,
}

Fields

source: &'a strdiagnostics: Vec<Diagnostic>

Implementations

impl<'a> RedundantNestingLinter<'a>[src]

pub fn new(source: &'a str) -> Self[src]

impl<'a> RedundantNestingLinter<'a>[src]

fn visit_nesting(&mut self, expr: &'a RcExpr, span: Span)[src]

Trait Implementations

impl<'a> DiagnosticRecord for RedundantNestingLinter<'a>[src]

The redundant nesting lint detects redundant nesting of expressions in parantheses or brackets.

For example, the following nestings are redundant and can be reduced to a single nesting:

((1))     -> (1)
[[1]]     -> [1]
([[(1)]]) -> (1)

Redundant nestings are difficult to read and may be misleading, as generally a single nesting is expected to host an expression for precedence or clarity reasons.

impl<'a> LintRule<'a, StmtList> for RedundantNestingLinter<'a>[src]

impl<'a> StmtVisitor<'a> for RedundantNestingLinter<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for RedundantNestingLinter<'a>

impl<'a> Send for RedundantNestingLinter<'a>

impl<'a> Sync for RedundantNestingLinter<'a>

impl<'a> Unpin for RedundantNestingLinter<'a>

impl<'a> UnwindSafe for RedundantNestingLinter<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.