summaryrefslogtreecommitdiff
path: root/src/deno_dir.rs
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2018-11-04 22:21:21 -0800
committerRyan Dahl <ry@tinyclouds.org>2018-11-06 06:43:02 -0800
commit13e1eb2b87c146a8594e7e6f24ba738bff116246 (patch)
tree9b7c8f8adc012073d728f2412ffe41c8ffe8a59b /src/deno_dir.rs
parentf477b45a0a398e379ecafd2525c460f2793a43c2 (diff)
Fix many of the clippy::pedantic warnings
Diffstat (limited to 'src/deno_dir.rs')
-rw-r--r--src/deno_dir.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/deno_dir.rs b/src/deno_dir.rs
index 2fe6bd337..b59d7b7ee 100644
--- a/src/deno_dir.rs
+++ b/src/deno_dir.rs
@@ -42,7 +42,7 @@ impl DenoDir {
pub fn new(
reload: bool,
custom_root: Option<&Path>,
- ) -> std::io::Result<DenoDir> {
+ ) -> std::io::Result<Self> {
// Only setup once.
let home_dir = dirs::home_dir().expect("Could not get home directory.");
let default = home_dir.join(".deno");
@@ -56,7 +56,7 @@ impl DenoDir {
let deps_http = deps.join("http");
let deps_https = deps.join("https");
- let deno_dir = DenoDir {
+ let deno_dir = Self {
root,
gen,
deps,
@@ -80,7 +80,7 @@ impl DenoDir {
// https://github.com/denoland/deno/blob/golang/deno_dir.go#L32-L35
pub fn cache_path(
- self: &DenoDir,
+ self: &Self,
filename: &str,
source_code: &str,
) -> (PathBuf, PathBuf) {
@@ -92,7 +92,7 @@ impl DenoDir {
}
fn load_cache(
- self: &DenoDir,
+ self: &Self,
filename: &str,
source_code: &str,
) -> Result<(String, String), std::io::Error> {
@@ -108,7 +108,7 @@ impl DenoDir {
}
pub fn code_cache(
- self: &DenoDir,
+ self: &Self,
filename: &str,
source_code: &str,
output_code: &str,
@@ -130,7 +130,7 @@ impl DenoDir {
// Prototype https://github.com/denoland/deno/blob/golang/deno_dir.go#L37-L73
fn fetch_remote_source(
- self: &DenoDir,
+ self: &Self,
module_name: &str,
filename: &str,
) -> DenoResult<(String, msg::MediaType)> {
@@ -161,7 +161,7 @@ impl DenoDir {
// Prototype: https://github.com/denoland/deno/blob/golang/os.go#L122-L138
fn get_source_code(
- self: &DenoDir,
+ self: &Self,
module_name: &str,
filename: &str,
) -> DenoResult<CodeFetchOutput> {
@@ -205,7 +205,7 @@ impl DenoDir {
}
pub fn code_fetch(
- self: &DenoDir,
+ self: &Self,
module_specifier: &str,
containing_file: &str,
) -> Result<CodeFetchOutput, DenoError> {
@@ -258,7 +258,7 @@ impl DenoDir {
}
// Prototype: https://github.com/denoland/deno/blob/golang/os.go#L56-L68
- fn src_file_to_url(self: &DenoDir, filename: &str) -> String {
+ fn src_file_to_url(self: &Self, filename: &str) -> String {
let filename_path = Path::new(filename);
if filename_path.starts_with(&self.deps) {
let (rest, prefix) = if filename_path.starts_with(&self.deps_https) {
@@ -287,7 +287,7 @@ impl DenoDir {
// Prototype: https://github.com/denoland/deno/blob/golang/os.go#L70-L98
// Returns (module name, local filename)
fn resolve_module(
- self: &DenoDir,
+ self: &Self,
module_specifier: &str,
containing_file: &str,
) -> Result<(String, String), url::ParseError> {