fn manage_initial_capture(&mut self, expr: &mut P<Expr>, path_ident: Ident) {
        if self.paths.contains(&path_ident) {
            return;
        } else {
            self.fmt_string.push_str("  ");
            self.fmt_string.push_str(path_ident.as_str());
            self.fmt_string.push_str(" = {:?}\n");
            let _ = self.paths.insert(path_ident);
        }
        let curr_capture_idx = self.capture_decls.len();
        let capture_string = format!("__capture{curr_capture_idx}");
        let ident = Ident::new(Symbol::intern(&capture_string), self.span);
        let init_std_path = self.cx.std_path(&[sym::asserting, sym::Capture, sym::new]);
        let init = self.cx.expr_call(
            self.span,
            self.cx.expr_path(self.cx.path(self.span, init_std_path)),
            vec![],
        );
        let capture = Capture { decl: self.cx.stmt_let(self.span, true, ident, init), ident };
        self.capture_decls.push(capture);
        self.manage_try_capture(ident, curr_capture_idx, expr);
    }
/// Pushes the top-level declarations and modifies `expr` to try capturing variables.
///
/// `fmt_str`, the formatting string used for debugging, is constructed to show possible
/// captured variables.
Pushes the top-level declarations and modifies `expr` to try capturing variables.
`fmt_str`, the formatting string used for debugging, is constructed to show possible
captured variables.
Pushes the top - level declarations and modifies ` expr ` to try capturing variables . ` fmt_str ` the formatting string used for debugging is constructed to show possible captured variables .
fn manage_initial_capture(&mut self, expr: &mut P<Expr>, path_ident: Ident) {
        if self.paths.contains(&path_ident) {
            return;
        } else {
            self.fmt_string.push_str("  ");
            self.fmt_string.push_str(path_ident.as_str());
            self.fmt_string.push_str(" = {:?}\n");
            let _ = self.paths.insert(path_ident);
        }
        let curr_capture_idx = self.capture_decls.len();
        let capture_string = format!("__capture{curr_capture_idx}");
        let ident = Ident::new(Symbol::intern(&capture_string), self.span);
        let init_std_path = self.cx.std_path(&[sym::asserting, sym::Capture, sym::new]);
        let init = self.cx.expr_call(
            self.span,
            self.cx.expr_path(self.cx.path(self.span, init_std_path)),
            vec![],
        );
        let capture = Capture { decl: self.cx.stmt_let(self.span, true, ident, init), ident };
        self.capture_decls.push(capture);
        self.manage_try_capture(ident, curr_capture_idx, expr);
    }
fn manage_initial_capture ( & mut self , expr : & mut P < Expr > , path_ident : Ident ) { if self . paths . contains ( & path_ident ) { return ; } else { self . fmt_string . push_str ( " " ) ; self . fmt_string . push_str ( path_ident . as_str ( ) ) ; self . fmt_string . push_str ( " \n " ) ; let _ = self . paths . insert ( path_ident ) ; } let curr_capture_idx = self . capture_decls . len ( ) ; let capture_string = format ! ( " " ) ; let ident = Ident :: new ( Symbol :: intern ( & capture_string ) , self . span ) ; let init_std_path = self . cx . std_path ( & [ sym :: asserting , sym :: Capture , sym :: new ] ) ; let init = self . cx . expr_call ( self . span , self . cx . expr_path ( self . cx . path ( self . span , init_std_path ) ) , vec ! [ ] , ) ; let capture = Capture { decl : self . cx . stmt_let ( self . span , true , ident , init ) , ident } ; self . capture_decls . push ( capture ) ; self . manage_try_capture ( ident , curr_capture_idx , expr ) ; }
Pushes the top-level declarations and modifies `expr` to try capturing variables.
Pushes the top - level declarations and modifies ` expr ` to try capturing variables .
&mut self
expr
&mut P<Expr>
path_ident
Ident
&mut self
expr
&mut P<Expr>
path_ident
Ident