diff options
Diffstat (limited to 'cli/module_graph.rs')
-rw-r--r-- | cli/module_graph.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs index 3fb1379f3..8b7a52906 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -458,7 +458,7 @@ impl ModuleGraphLoader { redirect: Some(source_file.url.to_string()), filename: source_file.filename.to_str().unwrap().to_string(), version_hash: checksum::gen(&[ - &source_file.source_code, + &source_file.source_code.as_bytes(), version::DENO.as_bytes(), ]), media_type: source_file.media_type, @@ -473,9 +473,11 @@ impl ModuleGraphLoader { } let module_specifier = ModuleSpecifier::from(source_file.url.clone()); - let version_hash = - checksum::gen(&[&source_file.source_code, version::DENO.as_bytes()]); - let source_code = String::from_utf8(source_file.source_code)?; + let version_hash = checksum::gen(&[ + &source_file.source_code.as_bytes(), + version::DENO.as_bytes(), + ]); + let source_code = source_file.source_code.to_string()?; if SUPPORTED_MEDIA_TYPES.contains(&source_file.media_type) { if let Some(types_specifier) = source_file.types_header { |