fn var_outlives_body(ctx: &AssistContext, body: &FunctionBody, var: &Local) -> bool {
    let usages = Definition::Local(*var)
        .usages(&ctx.sema)
        .in_scope(SearchScope::single_file(ctx.frange.file_id))
        .all();
    let mut usages = usages.iter().flat_map(|(_, rs)| rs.iter());

    usages.any(|reference| body.preceedes_range(reference.range))
}
/// checks if local variable is used after(outside of) body
checks if local variable is used after(outside of) body
checks if local variable is used after ( outside of ) body
fn var_outlives_body(ctx: &AssistContext, body: &FunctionBody, var: &Local) -> bool {
    let usages = Definition::Local(*var)
        .usages(&ctx.sema)
        .in_scope(SearchScope::single_file(ctx.frange.file_id))
        .all();
    let mut usages = usages.iter().flat_map(|(_, rs)| rs.iter());
    usages.any(|reference| body.preceedes_range(reference.range))
}
fn var_outlives_body ( ctx : & AssistContext , body : & FunctionBody , var : & Local ) -> bool { let usages = Definition :: Local ( * var ) . usages ( & ctx . sema ) . in_scope ( SearchScope :: single_file ( ctx . frange . file_id ) ) . all ( ) ; let mut usages = usages . iter ( ) . flat_map ( | ( _ , rs ) | rs . iter ( ) ) ; usages . any ( | reference | body . preceedes_range ( reference . range ) ) }
checks if local variable is used after(outside of) body
checks if local variable is used after ( outside of ) body
ctx
&AssistContext
body
&FunctionBody
var
&Local
ctx
&AssistContext
body
&FunctionBody
var
&Local