diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-07-28 23:50:45 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 09:50:45 -0400 |
commit | 076547fbbb52b1df9d6db36dd72353bffa9e4a8b (patch) | |
tree | 82cd78b705c04b9b712f7220df9c964b54af19d9 /cli/tsc.rs | |
parent | ccd0d0eb79db6ad33095ca06e9d491a27379b87a (diff) |
chore: use matches macro for bool matches (#6904)
Diffstat (limited to 'cli/tsc.rs')
-rw-r--r-- | cli/tsc.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/cli/tsc.rs b/cli/tsc.rs index 2ce498e3f..b42e23e10 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -586,10 +586,7 @@ impl TsCompiler { }; let root_names = vec![module_url.to_string()]; let unstable = self.flags.unstable; - let performance = match self.flags.log_level { - Some(Level::Debug) => true, - _ => false, - }; + let performance = matches!(self.flags.log_level, Some(Level::Debug)); let compiler_config = self.config.clone(); let cwd = std::env::current_dir().unwrap(); @@ -695,10 +692,8 @@ impl TsCompiler { let root_names = vec![module_specifier.to_string()]; let target = "main"; let cwd = std::env::current_dir().unwrap(); - let performance = match global_state.flags.log_level { - Some(Level::Debug) => true, - _ => false, - }; + let performance = + matches!(global_state.flags.log_level, Some(Level::Debug)); let compiler_config = self.config.clone(); @@ -771,10 +766,8 @@ impl TsCompiler { serde_json::to_value(source_files).expect("Filed to serialize data"); let compiler_config = self.config.clone(); let cwd = std::env::current_dir().unwrap(); - let performance = match global_state.flags.log_level { - Some(Level::Debug) => true, - _ => false, - }; + let performance = + matches!(global_state.flags.log_level, Some(Level::Debug)); let j = match (compiler_config.path, compiler_config.content) { (Some(config_path), Some(config_data)) => json!({ "config": str::from_utf8(&config_data).unwrap(), |