diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-01-31 22:15:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 03:15:22 +0000 |
commit | 4b7c6049ef9d40394eb823859c82cbf8d293430d (patch) | |
tree | 61e6de7c69c9d00faeef0ff7e6c223224a53de9e /cli/tools/repl/mod.rs | |
parent | 830d096b66696ad9f4e67b3ed8460fb1ff7a9170 (diff) |
refactor: load bytes in deno_graph (#22212)
Upgrades deno_graph to 0.64 where deno_graph is now responsible for
turning bytes into a string. This is in preparation for Wasm modules.
Diffstat (limited to 'cli/tools/repl/mod.rs')
-rw-r--r-- | cli/tools/repl/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs index f1fef6d54..e40c6362a 100644 --- a/cli/tools/repl/mod.rs +++ b/cli/tools/repl/mod.rs @@ -1,5 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::sync::Arc; + use crate::args::CliOptions; use crate::args::Flags; use crate::args::ReplFlags; @@ -140,7 +142,7 @@ async fn read_eval_file( cli_options: &CliOptions, file_fetcher: &FileFetcher, eval_file: &str, -) -> Result<String, AnyError> { +) -> Result<Arc<str>, AnyError> { let specifier = deno_core::resolve_url_or_path(eval_file, cli_options.initial_cwd())?; @@ -148,7 +150,7 @@ async fn read_eval_file( .fetch(&specifier, PermissionsContainer::allow_all()) .await?; - Ok((*file.source).to_string()) + Ok(file.into_text_decoded()?.source) } pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> { |