summaryrefslogtreecommitdiff
path: root/ext/node/ops.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-04-06 15:08:14 +0200
committerGitHub <noreply@github.com>2023-04-06 15:08:14 +0200
commit339165bd9565806374fa842dfc217dcc5ebabac5 (patch)
tree800fc65dacb90735bcb204133a13d450e46e9624 /ext/node/ops.rs
parent9626c48a018dc505b6c7b9c0c6632f8c45724ebe (diff)
refactor(ext/node): add more methods to 'NodeFs' trait (#18604)
Added more methods to `ext/node/clippy.toml` that are not allowed to be used in the crate. Prerequisite for https://github.com/denoland/deno/pull/18544
Diffstat (limited to 'ext/node/ops.rs')
-rw-r--r--ext/node/ops.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/node/ops.rs b/ext/node/ops.rs
index 5ecf70f3e..456c0dd51 100644
--- a/ext/node/ops.rs
+++ b/ext/node/ops.rs
@@ -264,8 +264,8 @@ where
{
let path = PathBuf::from(path);
ensure_read_permission::<Env::P>(state, &path)?;
- if let Ok(metadata) = Env::Fs::metadata(&path) {
- if metadata.is_file() {
+ if Env::Fs::exists(&path) {
+ if Env::Fs::is_file(&path) {
return Ok(0);
} else {
return Ok(1);
@@ -285,7 +285,7 @@ where
{
let path = PathBuf::from(request);
ensure_read_permission::<Env::P>(state, &path)?;
- let mut canonicalized_path = path.canonicalize()?;
+ let mut canonicalized_path = Env::Fs::canonicalize(&path)?;
if cfg!(windows) {
canonicalized_path = PathBuf::from(
canonicalized_path