clippy_utils::sugg

Function make_assoc

Source
pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static>
Expand description

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

Precedence of shift operator relative to other arithmetic operation is often confusing so parenthesis will always be added for a mix of these.