pub fn run(&self) {
        let CliOpt { kind, ref output } = self.opt;
        let cfg = build_cfg();

        let json = match kind {
            OutputKind::TypeScript => cfg.pipe(TypeScriptCfgWithSchema::from).pipe_ref(dump_json),
            OutputKind::Dprint => cfg.pipe(DprintCfg::from).pipe_ref(dump_json),
        }
        .expect("convert config to json");

        if let Some(filename) = output {
            let json = format!("{}\n", json);
            if let Err(error) = std::fs::write(filename, json) {
                eprintln!("✗ {}: {}", filename.to_string_lossy(), error);
            } else {
                eprintln!("💾 {}", filename.to_string_lossy());
            }
        } else {
            println!("{}", json);
        }
    }
/// Run the program based on application state.
Run the program based on application state.
Run the program based on application state .
pub fn run(&self) {
        let CliOpt { kind, ref output } = self.opt;
        let cfg = build_cfg();
        let json = match kind {
            OutputKind::TypeScript => cfg.pipe(TypeScriptCfgWithSchema::from).pipe_ref(dump_json),
            OutputKind::Dprint => cfg.pipe(DprintCfg::from).pipe_ref(dump_json),
        }
        .expect("convert config to json");
        if let Some(filename) = output {
            let json = format!("{}\n", json);
            if let Err(error) = std::fs::write(filename, json) {
                eprintln!("✗ {}: {}", filename.to_string_lossy(), error);
            } else {
                eprintln!("💾 {}", filename.to_string_lossy());
            }
        } else {
            println!("{}", json);
        }
    }
pub fn run ( & self ) { let CliOpt { kind , ref output } = self . opt ; let cfg = build_cfg ( ) ; let json = match kind { OutputKind :: TypeScript => cfg . pipe ( TypeScriptCfgWithSchema :: from ) . pipe_ref ( dump_json ) , OutputKind :: Dprint => cfg . pipe ( DprintCfg :: from ) . pipe_ref ( dump_json ) , } . expect ( " " ) ; if let Some ( filename ) = output { let json = format ! ( " \n " json ) ; if let Err ( error ) = std :: fs :: write ( filename , json ) { eprintln ! ( " lename.t _string_lossy() , ror); } else { eprintln ! ( " f ename.to string_lossy()) ; } } else { println ! ( " " json ) ; } }
Run the program based on application state.
Run the program based on application state .
&self
&self