summaryrefslogtreecommitdiff
path: root/ext/node/ops/require.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2023-08-08 16:28:18 -0400
committerGitHub <noreply@github.com>2023-08-08 16:28:18 -0400
commit03e963f57831367a39996c7d88bc9875e97d52d7 (patch)
tree8920cda4906ad9300550679d2492f0023d0beabc /ext/node/ops/require.rs
parentf2e30a6f7999fa6ce4ab789266927e3abbb48e3f (diff)
chore: rename some helpers on the Fs trait (#20097)
Rename some of the helper methods on the Fs trait to be suffixed with `_sync` / `_async`, in preparation of the introduction of more async methods for some helpers. Also adds a `read_text_file_async` helper to complement the renamed `read_text_file_sync` helper.
Diffstat (limited to 'ext/node/ops/require.rs')
-rw-r--r--ext/node/ops/require.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs
index f758ec973..f91970eef 100644
--- a/ext/node/ops/require.rs
+++ b/ext/node/ops/require.rs
@@ -426,7 +426,7 @@ where
let file_path = PathBuf::from(file_path);
ensure_read_permission::<P>(state, &file_path)?;
let fs = state.borrow::<FileSystemRc>();
- Ok(fs.read_to_string(&file_path)?)
+ Ok(fs.read_text_file_sync(&file_path)?)
}
#[op]
@@ -466,7 +466,7 @@ where
} else {
let original = modules_path.clone();
let mod_dir = path_resolve(vec![modules_path, name]);
- if fs.is_dir(Path::new(&mod_dir)) {
+ if fs.is_dir_sync(Path::new(&mod_dir)) {
mod_dir
} else {
original