[−][src]Struct libslide::linter::expr_pat::similar_names::SimilarNamesLinter
Fields
names: BTreeMap<&'a str, NameCollection>
Implementations
impl<'a> SimilarNamesLinter<'a>
[src]
fn check_names(self) -> Vec<Diagnostic>
[src]
Trait Implementations
impl<'a> Default for SimilarNamesLinter<'a>
[src]
fn default() -> SimilarNamesLinter<'a>
[src]
impl<'a> DiagnosticRecord for SimilarNamesLinter<'a>
[src]
The similar names lint detects expression patterns with very similar names.
For example, the following pattern expression has different patterns with the same suffix "a":
$a + #a + _a + $a
While this is expression is semantically valid, it can be difficuly to read and misleading, since "a" is used in three separate and independent patterns. A clearer expression would be
$a + #b + _c + $a
impl<'a> ExprPatVisitor<'a> for SimilarNamesLinter<'a>
[src]
fn visit_var_pat(&mut self, var_pat: &'a str, span: Span)
[src]
fn visit_const_pat(&mut self, const_pat: &'a str, span: Span)
[src]
fn visit_any_pat(&mut self, any_pat: &'a str, span: Span)
[src]
fn visit_expr_pat(&mut self, expr_pat: &'a RcExprPat)
[src]
fn visit_const(&mut self, _konst: &f64)
[src]
fn visit_binary_op(&mut self, _op: BinaryOperator)
[src]
fn visit_binary_expr_pat(&mut self, expr: &'a BinaryExpr<RcExprPat>)
[src]
fn visit_unary_op(&mut self, _op: UnaryOperator)
[src]
fn visit_unary_expr_pat(&mut self, expr: &'a UnaryExpr<RcExprPat>)
[src]
fn visit_parend_expr_pat(&mut self, expr: &'a RcExprPat, span: Span)
[src]
fn visit_bracketed_expr_pat(&mut self, expr: &'a RcExprPat, span: Span)
[src]
impl<'a> LintRule<'a, RcExprPat> for SimilarNamesLinter<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for SimilarNamesLinter<'a>
impl<'a> Send for SimilarNamesLinter<'a>
impl<'a> Sync for SimilarNamesLinter<'a>
impl<'a> Unpin for SimilarNamesLinter<'a>
impl<'a> UnwindSafe for SimilarNamesLinter<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,