diff options
author | Yiyu Lin <linyiyu1992@gmail.com> | 2020-05-16 03:26:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 15:26:16 -0400 |
commit | 871a0c9c0ea72aa95eb83e2e9010bdc05403f7d4 (patch) | |
tree | 44338e74a96abff4e031712cc5e0e3f532c36265 | |
parent | 8228ea85fd610d5496a3240538f15d2f4eed1d87 (diff) |
fix some clippy warning (#5462)
-rw-r--r-- | cli/ops/fs.rs | 12 | ||||
-rw-r--r-- | cli/swc_util.rs | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cli/ops/fs.rs b/cli/ops/fs.rs index 573058d70..116366c8d 100644 --- a/cli/ops/fs.rs +++ b/cli/ops/fs.rs @@ -833,9 +833,9 @@ fn op_make_temp_dir( // We can't assume that paths are always valid utf8 strings. let path = make_temp( // Converting Option<String> to Option<&str> - dir.as_ref().map(|x| &**x), - prefix.as_ref().map(|x| &**x), - suffix.as_ref().map(|x| &**x), + dir.as_deref(), + prefix.as_deref(), + suffix.as_deref(), true, )?; let path_str = into_string(path.into_os_string())?; @@ -864,9 +864,9 @@ fn op_make_temp_file( // We can't assume that paths are always valid utf8 strings. let path = make_temp( // Converting Option<String> to Option<&str> - dir.as_ref().map(|x| &**x), - prefix.as_ref().map(|x| &**x), - suffix.as_ref().map(|x| &**x), + dir.as_deref(), + prefix.as_deref(), + suffix.as_deref(), false, )?; let path_str = into_string(path.into_os_string())?; diff --git a/cli/swc_util.rs b/cli/swc_util.rs index a2e5d50fd..f579cbd36 100644 --- a/cli/swc_util.rs +++ b/cli/swc_util.rs @@ -161,7 +161,7 @@ impl AstParser { self .comments .take_leading_comments(span.lo()) - .unwrap_or_else(|| vec![]) + .unwrap_or_else(Vec::new) } } |