summaryrefslogtreecommitdiff
path: root/cli/ops.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-06-25 22:14:36 +0200
committerBert Belder <bertbelder@gmail.com>2019-07-08 13:07:32 +0200
commit72d9045528ad69ec32d7de9707cea65fab9f405e (patch)
tree7492b1109462be8512269a2a7041c02f4038e56e /cli/ops.rs
parent9b1997b8b6f82e17e42c43aae3621e2b932f5843 (diff)
cli: refactor deno_dir to use Url instead of String
Diffstat (limited to 'cli/ops.rs')
-rw-r--r--cli/ops.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/cli/ops.rs b/cli/ops.rs
index 218fb996e..770baf4ed 100644
--- a/cli/ops.rs
+++ b/cli/ops.rs
@@ -481,8 +481,12 @@ fn op_cache(
// cache path. In the future, checksums will not be used in the cache
// filenames and this requirement can be removed. See
// https://github.com/denoland/deno/issues/2057
+ let module_specifier = ModuleSpecifier::resolve_url(module_id)
+ .expect("Should be valid module specifier");
let module_meta_data =
- state.dir.fetch_module_meta_data(module_id, true, true)?;
+ state
+ .dir
+ .fetch_module_meta_data(&module_specifier, true, true)?;
let (js_cache_path, source_map_path) = state.dir.cache_path(
&PathBuf::from(&module_meta_data.filename),
@@ -525,11 +529,8 @@ fn op_fetch_module_meta_data(
let fut = state
.dir
- .fetch_module_meta_data_async(
- &resolved_specifier.to_string(),
- use_cache,
- no_fetch,
- ).and_then(move |out| {
+ .fetch_module_meta_data_async(&resolved_specifier, use_cache, no_fetch)
+ .and_then(move |out| {
let builder = &mut FlatBufferBuilder::new();
let data_off = builder.create_vector(out.source_code.as_slice());
let msg_args = msg::FetchModuleMetaDataResArgs {