Module clippy_utils::sugg[−][src]

Expand description

Contains utility functions to generate suggestions.

Macros

Copied from the rust standard library, and then edited

Structs

Helper type to display either foo or (foo).

Enums

Operator associativity.

A helper type to build suggestion correctly handling parentheses.

Constants

a constant represents an empty string, for convenience.

Literal constant 1, for convenience.

Literal constant 0, for convenience.

Traits

Convenience extension trait for DiagnosticBuilder.

Functions

Returns the associativity/fixity of an operator. The difference with AssocOp::fixity is that an operator can be both left and right associative (such as +: a + b + c == (a + b) + c == a + (b + c).

Converts an ast::BinOp to the corresponding assigning binary operator.

Return true if sugg is enclosed in parenthesis.

Converts a hir::BinOp to the corresponding assigning binary operator.

Returns the indentation before span if there are nothing but [ \t] before it on its line.

Builds the string for <lhs> <op> <rhs> adding parenthesis when necessary.

Convenience wrapper around make_assoc and AssocOp::from_ast_binop.

Builds the string for <op><expr> adding parenthesis when necessary.