diff options
Diffstat (limited to 'cli/cache')
-rw-r--r-- | cli/cache/check.rs | 6 | ||||
-rw-r--r-- | cli/cache/disk_cache.rs | 7 | ||||
-rw-r--r-- | cli/cache/emit.rs | 2 | ||||
-rw-r--r-- | cli/cache/http_cache.rs | 7 | ||||
-rw-r--r-- | cli/cache/incremental.rs | 2 | ||||
-rw-r--r-- | cli/cache/node.rs | 4 |
6 files changed, 13 insertions, 15 deletions
diff --git a/cli/cache/check.rs b/cli/cache/check.rs index 86fb07577..c991c14b1 100644 --- a/cli/cache/check.rs +++ b/cli/cache/check.rs @@ -71,7 +71,7 @@ impl TypeCheckCache { Ok(val) => val, Err(err) => { if cfg!(debug_assertions) { - panic!("Error retrieving hash: {}", err); + panic!("Error retrieving hash: {err}"); } else { log::debug!("Error retrieving hash: {}", err); // fail silently when not debugging @@ -94,7 +94,7 @@ impl TypeCheckCache { pub fn add_check_hash(&self, check_hash: u64) { if let Err(err) = self.add_check_hash_result(check_hash) { if cfg!(debug_assertions) { - panic!("Error saving check hash: {}", err); + panic!("Error saving check hash: {err}"); } else { log::debug!("Error saving check hash: {}", err); } @@ -134,7 +134,7 @@ impl TypeCheckCache { if let Err(err) = self.set_tsbuildinfo_result(specifier, text) { // should never error here, but if it ever does don't fail if cfg!(debug_assertions) { - panic!("Error saving tsbuildinfo: {}", err); + panic!("Error saving tsbuildinfo: {err}"); } else { log::debug!("Error saving tsbuildinfo: {}", err); } diff --git a/cli/cache/disk_cache.rs b/cli/cache/disk_cache.rs index b97850204..799610d5f 100644 --- a/cli/cache/disk_cache.rs +++ b/cli/cache/disk_cache.rs @@ -43,8 +43,7 @@ impl DiskCache { } fs::create_dir_all(path).map_err(|e| { io::Error::new(e.kind(), format!( - "Could not create TypeScript compiler cache location: {:?}\nCheck the permission of the directory.", - path + "Could not create TypeScript compiler cache location: {path:?}\nCheck the permission of the directory." )) }) } @@ -61,7 +60,7 @@ impl DiskCache { let host_port = match url.port() { // Windows doesn't support ":" in filenames, so we represent port using a // special string. - Some(port) => format!("{}_PORT{}", host, port), + Some(port) => format!("{host}_PORT{port}"), None => host.to_string(), }; out.push(host_port); @@ -128,7 +127,7 @@ impl DiskCache { None => Some(base.with_extension(extension)), Some(ext) => { let original_extension = OsStr::to_str(ext).unwrap(); - let final_extension = format!("{}.{}", original_extension, extension); + let final_extension = format!("{original_extension}.{extension}"); Some(base.with_extension(final_extension)) } } diff --git a/cli/cache/emit.rs b/cli/cache/emit.rs index 21f382c55..89ff496fd 100644 --- a/cli/cache/emit.rs +++ b/cli/cache/emit.rs @@ -90,7 +90,7 @@ impl EmitCache { if let Err(err) = self.set_emit_code_result(specifier, source_hash, code) { // should never error here, but if it ever does don't fail if cfg!(debug_assertions) { - panic!("Error saving emit data ({}): {}", specifier, err); + panic!("Error saving emit data ({specifier}): {err}"); } else { log::debug!("Error saving emit data({}): {}", specifier, err); } diff --git a/cli/cache/http_cache.rs b/cli/cache/http_cache.rs index 4be3166c9..2e784765e 100644 --- a/cli/cache/http_cache.rs +++ b/cli/cache/http_cache.rs @@ -35,7 +35,7 @@ fn base_url_to_filename(url: &Url) -> Option<PathBuf> { "http" | "https" => { let host = url.host_str().unwrap(); let host_port = match url.port() { - Some(port) => format!("{}_PORT{}", host, port), + Some(port) => format!("{host}_PORT{port}"), None => host.to_string(), }; out.push(host_port); @@ -128,8 +128,7 @@ impl HttpCache { io::Error::new( e.kind(), format!( - "Could not create remote modules cache location: {:?}\nCheck the permission of the directory.", - path + "Could not create remote modules cache location: {path:?}\nCheck the permission of the directory." ), ) }) @@ -231,7 +230,7 @@ mod tests { headers.insert("etag".to_string(), "as5625rqdsfb".to_string()); let content = b"Hello world"; let r = cache.set(&url, headers, content); - eprintln!("result {:?}", r); + eprintln!("result {r:?}"); assert!(r.is_ok()); let r = cache.get(&url); assert!(r.is_ok()); diff --git a/cli/cache/incremental.rs b/cli/cache/incremental.rs index 652965ad7..985181c59 100644 --- a/cli/cache/incremental.rs +++ b/cli/cache/incremental.rs @@ -185,7 +185,7 @@ impl SqlIncrementalCache { Ok(option) => option, Err(err) => { if cfg!(debug_assertions) { - panic!("Error retrieving hash: {}", err); + panic!("Error retrieving hash: {err}"); } else { // fail silently when not debugging None diff --git a/cli/cache/node.rs b/cli/cache/node.rs index ec0121c61..b19772229 100644 --- a/cli/cache/node.rs +++ b/cli/cache/node.rs @@ -108,7 +108,7 @@ impl NodeAnalysisCache { Err(err) => { // should never error here, but if it ever does don't fail if cfg!(debug_assertions) { - panic!("Error creating node analysis cache: {:#}", err); + panic!("Error creating node analysis cache: {err:#}"); } else { log::debug!("Error creating node analysis cache: {:#}", err); None @@ -124,7 +124,7 @@ impl NodeAnalysisCache { Err(err) => { // should never error here, but if it ever does don't fail if cfg!(debug_assertions) { - panic!("Error using esm analysis: {:#}", err); + panic!("Error using esm analysis: {err:#}"); } else { log::debug!("Error using esm analysis: {:#}", err); } |