1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix some clippy warning (#5462)

This commit is contained in:
Yiyu Lin 2020-05-16 03:26:16 +08:00 committed by GitHub
parent 8228ea85fd
commit 871a0c9c0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -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())?;

View file

@ -161,7 +161,7 @@ impl AstParser {
self
.comments
.take_leading_comments(span.lo())
.unwrap_or_else(|| vec![])
.unwrap_or_else(Vec::new)
}
}