diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-07-31 17:11:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-31 17:11:37 -0400 |
commit | 3971dcfe10b94e901a224b5328a9dafd1e2ecc08 (patch) | |
tree | e347644a90094774e56e9315119c31594ca60796 /cli/compilers | |
parent | b3541c38f5672ffb4a29d66dca19d88b9ecae478 (diff) |
Use system rustfmt instead of fixed binary (#2701)
Diffstat (limited to 'cli/compilers')
-rw-r--r-- | cli/compilers/ts.rs | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index bbfe33461..9855086b6 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -96,7 +96,8 @@ impl CompilerConfig { DenoError::new( ErrorKind::InvalidInput, "Compiler config is not a valid JSON".to_string(), - ).into(), + ) + .into(), ), } } @@ -153,15 +154,15 @@ fn req( ) -> Buf { let j = match (compiler_config.path, compiler_config.content) { (Some(config_path), Some(config_data)) => json!({ - "rootNames": root_names, - "bundle": bundle, - "configPath": config_path, - "config": str::from_utf8(&config_data).unwrap(), - }), + "rootNames": root_names, + "bundle": bundle, + "configPath": config_path, + "config": str::from_utf8(&config_data).unwrap(), + }), _ => json!({ - "rootNames": root_names, - "bundle": bundle, - }), + "rootNames": root_names, + "bundle": bundle, + }), }; j.to_string().into_boxed_str().into_boxed_bytes() @@ -410,7 +411,8 @@ impl TsCompiler { } Ok(()) - }).and_then(move |_| { + }) + .and_then(move |_| { // if we are this far it means compilation was successful and we can // load compiled filed from disk state_ @@ -420,12 +422,14 @@ impl TsCompiler { // TODO: this situation shouldn't happen panic!("Expected to find compiled file: {}", e) }) - }).and_then(move |compiled_module| { + }) + .and_then(move |compiled_module| { // Explicit drop to keep reference alive until future completes. drop(compiling_job); Ok(compiled_module) - }).then(move |r| { + }) + .then(move |r| { debug!(">>>>> compile_sync END"); // TODO(ry) do this in worker's destructor. // resource.close(); @@ -685,12 +689,10 @@ mod tests { .ts_compiler .compile_sync(mock_state.clone(), &out) .unwrap(); - assert!( - compiled - .code - .as_bytes() - .starts_with("console.log(\"Hello World\");".as_bytes()) - ); + assert!(compiled + .code + .as_bytes() + .starts_with("console.log(\"Hello World\");".as_bytes())); }) } |