summaryrefslogtreecommitdiff
path: root/cli/compiler.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-06-24 19:10:21 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-06-24 10:10:21 -0700
commit70a9859adce478180a15d43877fe239a44379556 (patch)
tree2ff6108cadc265bf5b80215dbcf4de9f134e7ef9 /cli/compiler.rs
parent3c81cca0374c96ff4759ec9305eb5529dd29a4d8 (diff)
refactor: use Path/PathBuf in deno dir (#2559)
Diffstat (limited to 'cli/compiler.rs')
-rw-r--r--cli/compiler.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/compiler.rs b/cli/compiler.rs
index b6fb0375c..dc30758b2 100644
--- a/cli/compiler.rs
+++ b/cli/compiler.rs
@@ -11,6 +11,7 @@ use crate::worker::Worker;
use deno::Buf;
use futures::Future;
use futures::Stream;
+use std::path::PathBuf;
use std::str;
use std::sync::atomic::Ordering;
@@ -20,12 +21,12 @@ use std::sync::atomic::Ordering;
pub struct ModuleMetaData {
pub module_name: String,
pub module_redirect_source_name: Option<String>, // source of redirect
- pub filename: String,
+ pub filename: PathBuf,
pub media_type: msg::MediaType,
pub source_code: Vec<u8>,
- pub maybe_output_code_filename: Option<String>,
+ pub maybe_output_code_filename: Option<PathBuf>,
pub maybe_output_code: Option<Vec<u8>>,
- pub maybe_source_map_filename: Option<String>,
+ pub maybe_source_map_filename: Option<PathBuf>,
pub maybe_source_map: Option<Vec<u8>>,
}
@@ -214,7 +215,6 @@ pub fn compile_async(
}).and_then(move |_| {
state.dir.fetch_module_meta_data_async(
&module_name,
- ".",
true,
true,
).map_err(|e| {
@@ -256,7 +256,7 @@ mod tests {
let mut out = ModuleMetaData {
module_name,
module_redirect_source_name: None,
- filename: "/tests/002_hello.ts".to_owned(),
+ filename: PathBuf::from("/tests/002_hello.ts"),
media_type: msg::MediaType::TypeScript,
source_code: include_bytes!("../tests/002_hello.ts").to_vec(),
maybe_output_code_filename: None,