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: object_rest.rs
    path of file: ./repos/swc/crates/swc_ecma_compat_es2018/src
    
    the code of the file until where you have to start completion: use std::{
    iter,
    mem::{self, replace},
};

use swc_common::{util::take::Take, Mark, Spanned, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_compat_common::impl_visit_mut_fn;
use swc_ecma_transforms_base::{helper, helper_expr, perf::Check};
use swc_ecma_transforms_macros::fast_path;
use swc_ecma_utils::{
    alias_ident_for, alias_if_required, find_pat_ids, is_literal, private_ident
    
    fn insert_var_if_not_empty(&mut self, idx: usize, mut decl: VarDeclarator) {
        if let Some(e1) = decl.init {
            if let Expr::Ident(ref i1) = *e1 {
                if let Pat::Ident(ref i2) = decl.name {
                    if *i1 == i2.id {
                        return;
                    }
                }
            }
            decl.init = Some(e1);
        }

        if let Pat::Object(..) | Pat::Array(..) = decl.name {
            let ids: Vec<Id> = find_pat_ids(&decl.name);
            if ids.is_empty() {
                return;
            }
        }
        self.vars.insert(idx, decl)
    }