fn reference_is_exclusive(
    reference: &FileReference,
    body: &FunctionBody,
    ctx: &AssistContext,
) -> bool {
    // we directly modify variable with set: `n = 0`, `n += 1`
    if reference.access == Some(ReferenceAccess::Write) {
        return true;
    }

    // we take `&mut` reference to variable: `&mut v`
    let path = match path_element_of_reference(body, reference) {
        Some(path) => path,
        None => return false,
    };

    expr_require_exclusive_access(ctx, &path).unwrap_or(false)
}
/// checks if this reference requires `&mut` access inside body
checks if this reference requires `&mut` access inside body
checks if this reference requires ` &mut ` access inside body
fn reference_is_exclusive(
    reference: &FileReference,
    body: &FunctionBody,
    ctx: &AssistContext,
) -> bool {
    // we directly modify variable with set: `n = 0`, `n += 1`
    if reference.access == Some(ReferenceAccess::Write) {
        return true;
    }
    // we take `&mut` reference to variable: `&mut v`
    let path = match path_element_of_reference(body, reference) {
        Some(path) => path,
        None => return false,
    };
    expr_require_exclusive_access(ctx, &path).unwrap_or(false)
}
fn reference_is_exclusive ( reference : & FileReference , body : & FunctionBody , ctx : & AssistContext , ) -> bool { // we directly modify variable with set: `n = 0`, `n += 1` if reference . access == Some ( ReferenceAccess :: Write ) { return true ; } // we take `&mut` reference to variable: `&mut v` let path = match path_element_of_reference ( body , reference ) { Some ( path ) => path , None => return false , } ; expr_require_exclusive_access ( ctx , & path ) . unwrap_or ( false ) }
checks if this reference requires `&mut` access inside body
checks if this reference requires ` &mut ` access inside body
reference
&FileReference
body
&FunctionBody
ctx
&AssistContext
reference
&FileReference
body
&FunctionBody
ctx
&AssistContext