summaryrefslogtreecommitdiff
path: root/cli/node.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 /cli/node.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 'cli/node.rs')
-rw-r--r--cli/node.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/node.rs b/cli/node.rs
index 2a9a84ef9..158627202 100644
--- a/cli/node.rs
+++ b/cli/node.rs
@@ -91,9 +91,11 @@ impl CjsCodeAnalyzer for CliCjsCodeAnalyzer {
) -> Result<ExtNodeCjsAnalysis, AnyError> {
let source = match source {
Some(source) => Cow::Borrowed(source),
- None => {
- Cow::Owned(self.fs.read_to_string(&specifier.to_file_path().unwrap())?)
- }
+ None => Cow::Owned(
+ self
+ .fs
+ .read_text_file_sync(&specifier.to_file_path().unwrap())?,
+ ),
};
let analysis = self.inner_cjs_analysis(specifier, &source)?;
Ok(ExtNodeCjsAnalysis {