summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/bench/main.rs2
-rw-r--r--cli/disk_cache.rs4
-rw-r--r--cli/lsp/language_server.rs2
-rw-r--r--cli/specifier_handler.rs16
4 files changed, 12 insertions, 12 deletions
diff --git a/cli/bench/main.rs b/cli/bench/main.rs
index e15f76277..d19731faa 100644
--- a/cli/bench/main.rs
+++ b/cli/bench/main.rs
@@ -439,7 +439,7 @@ struct BenchResult {
we replace the harness with our own runner here.
*/
fn main() -> Result<()> {
- if env::args().find(|s| s == "--bench").is_none() {
+ if !env::args().any(|s| s == "--bench") {
return Ok(());
}
diff --git a/cli/disk_cache.rs b/cli/disk_cache.rs
index 0f5d16f98..d24acc3ab 100644
--- a/cli/disk_cache.rs
+++ b/cli/disk_cache.rs
@@ -170,12 +170,12 @@ mod tests {
let mut cache_location = temp_dir.path().to_owned();
assert!(fs::remove_dir(&cache_location).is_ok());
cache_location.push("foo");
- assert_eq!(cache_location.is_dir(), false);
+ assert!(!cache_location.is_dir());
let cache = DiskCache::new(&cache_location);
cache
.ensure_dir_exists(&cache.location)
.expect("Testing expect:");
- assert_eq!(cache_location.is_dir(), true);
+ assert!(cache_location.is_dir());
}
#[test]
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index 9d9e97e12..022d56aae 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -504,7 +504,7 @@ impl Inner {
specifier: &ModuleSpecifier,
) -> Result<Option<AssetDocument>, AnyError> {
if let Some(maybe_asset) = self.assets.get(specifier) {
- return Ok(maybe_asset.clone());
+ Ok(maybe_asset.clone())
} else {
let maybe_asset =
tsc::get_asset(&specifier, &self.ts_server, self.snapshot()?).await?;
diff --git a/cli/specifier_handler.rs b/cli/specifier_handler.rs
index cd27e45cc..f1cda0b69 100644
--- a/cli/specifier_handler.rs
+++ b/cli/specifier_handler.rs
@@ -670,7 +670,7 @@ pub mod tests {
.unwrap();
let cached_module: CachedModule =
file_fetcher.fetch(specifier, None, false).await.unwrap();
- assert_eq!(cached_module.is_remote, true);
+ assert!(cached_module.is_remote);
let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let specifier = resolve_url_or_path(
c.join("tests/subdir/mod1.ts").as_os_str().to_str().unwrap(),
@@ -678,7 +678,7 @@ pub mod tests {
.unwrap();
let cached_module: CachedModule =
file_fetcher.fetch(specifier, None, false).await.unwrap();
- assert_eq!(cached_module.is_remote, false);
+ assert!(!cached_module.is_remote);
}
#[tokio::test]
@@ -716,7 +716,7 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::TypeScript);
- assert_eq!(actual.is_remote, false);
+ assert!(!actual.is_remote);
let specifier = resolve_url_or_path("file:///b.ts").unwrap();
let actual: CachedModule = handler
@@ -727,7 +727,7 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::TypeScript);
- assert_eq!(actual.is_remote, false);
+ assert!(!actual.is_remote);
let specifier = resolve_url_or_path("https://deno.land/x/c.js").unwrap();
let actual: CachedModule = handler
@@ -738,7 +738,7 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::JavaScript);
- assert_eq!(actual.is_remote, true);
+ assert!(actual.is_remote);
let specifier = resolve_url_or_path("https://deno.land/x/d.d.ts").unwrap();
let actual: CachedModule = handler
@@ -749,7 +749,7 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::Dts);
- assert_eq!(actual.is_remote, true);
+ assert!(actual.is_remote);
let specifier =
resolve_url_or_path("https://deno.land/x/missing.ts").unwrap();
@@ -767,7 +767,7 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::TypeScript);
- assert_eq!(actual.is_remote, false);
+ assert!(!actual.is_remote);
let specifier = resolve_url_or_path("file:///C:/a.ts").unwrap();
let actual: CachedModule = handler
@@ -778,6 +778,6 @@ pub mod tests {
assert_eq!(actual.requested_specifier, specifier);
assert_eq!(actual.specifier, specifier);
assert_eq!(actual.media_type, MediaType::TypeScript);
- assert_eq!(actual.is_remote, false);
+ assert!(!actual.is_remote);
}
}