diff options
author | Gurwinder Singh <vargwin@gmail.com> | 2020-01-04 15:50:52 +0530 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-04 05:20:52 -0500 |
commit | 9f6bab6010abb26814d6d7a163db24fa5965d09c (patch) | |
tree | d680722aeffb6535de0f49689a4dbf8763836b2c /cli/disk_cache.rs | |
parent | 70b1be6ff459ebd2bf57b7788ab7d66c1f375b29 (diff) |
Use async at places, use &self instead of self: &Self (#3594)
Diffstat (limited to 'cli/disk_cache.rs')
-rw-r--r-- | cli/disk_cache.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/disk_cache.rs b/cli/disk_cache.rs index 975a31f45..a6689c6ec 100644 --- a/cli/disk_cache.rs +++ b/cli/disk_cache.rs @@ -21,7 +21,7 @@ impl DiskCache { } } - pub fn get_cache_filename(self: &Self, url: &Url) -> PathBuf { + pub fn get_cache_filename(&self, url: &Url) -> PathBuf { let mut out = PathBuf::new(); let scheme = url.scheme(); @@ -83,7 +83,7 @@ impl DiskCache { } pub fn get_cache_filename_with_extension( - self: &Self, + &self, url: &Url, extension: &str, ) -> PathBuf { @@ -99,12 +99,12 @@ impl DiskCache { } } - pub fn get(self: &Self, filename: &Path) -> std::io::Result<Vec<u8>> { + pub fn get(&self, filename: &Path) -> std::io::Result<Vec<u8>> { let path = self.location.join(filename); fs::read(&path) } - pub fn set(self: &Self, filename: &Path, data: &[u8]) -> std::io::Result<()> { + pub fn set(&self, filename: &Path, data: &[u8]) -> std::io::Result<()> { let path = self.location.join(filename); match path.parent() { Some(ref parent) => fs::create_dir_all(parent), @@ -113,7 +113,7 @@ impl DiskCache { deno_fs::write_file(&path, data, 0o666) } - pub fn remove(self: &Self, filename: &Path) -> std::io::Result<()> { + pub fn remove(&self, filename: &Path) -> std::io::Result<()> { let path = self.location.join(filename); fs::remove_file(path) } |