fn update_resolution<T, F>(&self, name: Name, ns: Namespace, update: F) -> T
        where F: FnOnce(&mut NameResolution<'a>) -> T
    {
        // Ensure that `resolution` isn't borrowed during `define_in_glob_importers`,
        // where it might end up getting re-defined via a glob cycle.
        let (new_binding, t) = {
            let mut resolution = &mut *self.resolution(name, ns).borrow_mut();
            let was_known = resolution.binding().is_some();

            let t = update(resolution);

            if was_known { return t; }
            match resolution.binding() {
                Some(binding) => (binding, t),
                None => return t,
            }
        };

        self.define_in_glob_importers(name, ns, new_binding);
        t
    }
// Use `update` to mutate the resolution for the name.
// If the resolution becomes a success, define it in the module's glob importers.
Use `update` to mutate the resolution for the name.
If the resolution becomes a success, define it in the module's glob importers.
Use ` update ` to mutate the resolution for the name . If the resolution becomes a success define it in the module ' s glob importers .
fn update_resolution<T, F>(&self, name: Name, ns: Namespace, update: F) -> T
        where F: FnOnce(&mut NameResolution<'a>) -> T
    {
        // Ensure that `resolution` isn't borrowed during `define_in_glob_importers`,
        // where it might end up getting re-defined via a glob cycle.
        let (new_binding, t) = {
            let mut resolution = &mut *self.resolution(name, ns).borrow_mut();
            let was_known = resolution.binding().is_some();
            let t = update(resolution);
            if was_known { return t; }
            match resolution.binding() {
                Some(binding) => (binding, t),
                None => return t,
            }
        };
        self.define_in_glob_importers(name, ns, new_binding);
        t
    }
fn update_resolution < T , F > ( & self , name : Name , ns : Namespace , update : F ) -> T where F : FnOnce ( & mut NameResolution < ' a > ) -> T { // Ensure that `resolution` isn't borrowed during `define_in_glob_importers`, // where it might end up getting re-defined via a glob cycle. let ( new_binding , t ) = { let mut resolution = & mut * self . resolution ( name , ns ) . borrow_mut ( ) ; let was_known = resolution . binding ( ) . is_some ( ) ; let t = update ( resolution ) ; if was_known { return t ; } match resolution . binding ( ) { Some ( binding ) => ( binding , t ) , None => return t , } } ; self . define_in_glob_importers ( name , ns , new_binding ) ; t }
Use `update` to mutate the resolution for the name.
Use ` update ` to mutate the resolution for the name .
&self
name
Name
ns
Namespace
update
F
&self
name
Name
ns
Namespace
update
F