clippy_utils::visitors

Function local_used_once

Source
pub fn local_used_once<'tcx>(
    cx: &LateContext<'tcx>,
    visitable: impl Visitable<'tcx>,
    id: HirId,
) -> Option<&'tcx Expr<'tcx>>
Expand description

If the local is only used once in visitable returns the path expression referencing the given local