clippy_utils::sugg

Function deref_closure_args

Source
pub fn deref_closure_args(
    cx: &LateContext<'_>,
    closure: &Expr<'_>,
) -> Option<DerefClosure>
Expand description

Build suggestion gradually by handling closure arg specific usages, such as explicit deref and borrowing cases. Returns None if no such use cases have been triggered in closure body

note: this only works on single line immutable closures with exactly one input parameter.