diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-05-05 13:16:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 13:16:25 +0200 |
commit | 45a4d75296b221240a2842bae0aef21622e21f97 (patch) | |
tree | a0af348a54099f9dd2b2be34c1e071375bc99d6d /cli/standalone.rs | |
parent | 242273e69b5f5add23393e8e96e241696eae88fb (diff) |
refactor(core): use Box<u8> for ModuleSource.code instead of a String (#14487)
Diffstat (limited to 'cli/standalone.rs')
-rw-r--r-- | cli/standalone.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/standalone.rs b/cli/standalone.rs index 1d75734be..13bc3e70f 100644 --- a/cli/standalone.rs +++ b/cli/standalone.rs @@ -168,9 +168,9 @@ impl ModuleLoader for EmbeddedModuleLoader { .ok_or_else(|| type_error("Module not found")); async move { - if let Some((ref source, _)) = is_data_uri { + if let Some((source, _)) = is_data_uri { return Ok(deno_core::ModuleSource { - code: source.to_owned(), + code: source.into_bytes().into_boxed_slice(), module_type: deno_core::ModuleType::JavaScript, module_url_specified: module_specifier.to_string(), module_url_found: module_specifier.to_string(), @@ -184,7 +184,7 @@ impl ModuleLoader for EmbeddedModuleLoader { .to_owned(); Ok(deno_core::ModuleSource { - code, + code: code.into_bytes().into_boxed_slice(), module_type: match module.kind { eszip::ModuleKind::JavaScript => deno_core::ModuleType::JavaScript, eszip::ModuleKind::Json => deno_core::ModuleType::Json, |