You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: block_scoped_fn.rs
    path of file: ./repos/swc/crates/swc_ecma_compat_es2015/src
    
    the code of the file until where you have to start completion: use swc_common::{util::take::Take, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_utils::IdentUsageFinder;
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

pub fn block_scoped_functions() -> impl Fold + VisitMut {
    as_folder(BlockScopedFns)
}

#[derive(Clone, Copy)]
struct BlockScopedFns;

#[swc_trace]
impl VisitMut for BlockScopedFns {
    noop_visit_mut_type!();

    fn visit_mut_function(&mut self, n: &mut Function) {
        let Some(body) = &mut n.body else { return };

        n.params.visit_mut_with(self);

        // skip function scope
        body.visit_mut_children_with(self);
    }

    fn visit_mut_block_stmt(&mut self, n: &mut BlockStmt) {
        n.visit_mut_children_with(self);

        let mut stmts = Vec::with_capacity(n.stmts.len());
        let mut extra_stmts = Vec::with_capacity(n.stmts.len());

        for stmt in n.stmts.take() {
            if let Stmt::Expr(ExprStmt { ref expr, .. }) = stmt {
                if let Expr::Lit(Lit::Str(..)) = &**expr {
                    stmts.push(stmt);
                    continue;
                }
            }

            if let Stmt::Decl(Decl::Fn(decl)) = stmt {
                if IdentUsageFinder::find(&decl.ident.to_id(), &decl.function) {
                    extra_stmts.push(Stmt::Decl(Decl::Fn(decl)));
                    continue;
                }
                stmts.push(
                    VarDecl {
                        span: DUMMY_SP,
    
    
    fn visit_mut_block_stmt(&mut self, n: &mut BlockStmt) {
        n.visit_mut_children_with(self);

        let mut stmts = Vec::with_capacity(n.stmts.len());
        let mut extra_stmts = Vec::with_capacity(n.stmts.len());

        for stmt in n.stmts.take() {
            if let Stmt::Expr(ExprStmt { ref expr, .. }) = stmt {
                if let Expr::Lit(Lit::Str(..)) = &**expr {
                    stmts.push(stmt);
                    continue;
                }
            }

            if let Stmt::Decl(Decl::Fn(decl)) = stmt {
                if IdentUsageFinder::find(&decl.ident.to_id(), &decl.function) {
                    extra_stmts.push(Stmt::Decl(Decl::Fn(decl)));
                    continue;
                }
                stmts.push(
                    VarDecl {
                        span: DUMMY_SP,
                        kind: VarDeclKind::Let,
                        decls: vec![VarDeclarator {
                            span: DUMMY_SP,
                            name: decl.ident.clone().into(),
                            init: Some(Box::new(Expr::Fn(FnExpr {
                                ident: Some(decl.ident),
                                function: decl.function,
                            }))),
                            definite: false,
                        }],
                        declare: false,
                    }
                    .into(),
                )
            } else {
                extra_stmts.push(stmt)
            }
        }

        stmts.append(&mut extra_stmts);

        n.stmts = stmts
    }