diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-06-15 13:22:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 19:22:28 +0200 |
commit | 9c42b5e03b6500aaf38b37b208ad9ae1ba2bbaf3 (patch) | |
tree | 0e92b77eda7126ed8169b168de343b6a19f6a7c4 | |
parent | b6fd39377ee68dda0a5d82ed7f5dba9c61583a43 (diff) |
Remove various unnecessary allow(clippy) declarations (#10971)
-rw-r--r-- | cli/lsp/config.rs | 10 | ||||
-rw-r--r-- | cli/lsp/tsc.rs | 3 | ||||
-rw-r--r-- | extensions/timers/lib.rs | 4 | ||||
-rw-r--r-- | runtime/metrics.rs | 1 | ||||
-rw-r--r-- | runtime/ops/fs.rs | 1 | ||||
-rw-r--r-- | runtime/ops/signal.rs | 1 | ||||
-rw-r--r-- | runtime/ops/web_worker.rs | 2 | ||||
-rw-r--r-- | runtime/ops/worker_host.rs | 1 | ||||
-rw-r--r-- | test_plugin/src/lib.rs | 1 |
9 files changed, 4 insertions, 20 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 554bfd1e9..ca2a535ef 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -365,17 +365,15 @@ impl Config { value } - #[allow(clippy::redundant_closure_call)] pub fn update_capabilities( &mut self, capabilities: &lsp::ClientCapabilities, ) { if let Some(experimental) = &capabilities.experimental { - let get_bool = - |k: &str| experimental.get(k).and_then(|it| it.as_bool()) == Some(true); - - self.client_capabilities.status_notification = - get_bool("statusNotification"); + self.client_capabilities.status_notification = experimental + .get("statusNotification") + .and_then(|it| it.as_bool()) + == Some(true) } if let Some(workspace) = &capabilities.workspace { diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 834ac0a0c..d1690b252 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -1868,7 +1868,6 @@ struct SourceSnapshotArgs { /// The language service is dropping a reference to a source file snapshot, and /// we can drop our version of that document. -#[allow(clippy::unnecessary_wraps)] fn op_dispose( state: &mut State, args: SourceSnapshotArgs, @@ -2091,13 +2090,11 @@ fn op_resolve( Ok(resolved) } -#[allow(clippy::unnecessary_wraps)] fn op_respond(state: &mut State, args: Response) -> Result<bool, AnyError> { state.response = Some(args); Ok(true) } -#[allow(clippy::unnecessary_wraps)] fn op_script_names( state: &mut State, _args: Value, diff --git a/extensions/timers/lib.rs b/extensions/timers/lib.rs index 66e7d05ed..43a40e939 100644 --- a/extensions/timers/lib.rs +++ b/extensions/timers/lib.rs @@ -100,7 +100,6 @@ impl GlobalTimer { } } -#[allow(clippy::unnecessary_wraps)] pub fn op_global_timer_stop( state: &mut OpState, _args: (), @@ -118,7 +117,6 @@ pub fn op_global_timer_stop( // // See https://github.com/denoland/deno/issues/7599 for more // details. -#[allow(clippy::unnecessary_wraps)] pub fn op_global_timer_start( state: &mut OpState, timeout: u64, @@ -150,7 +148,6 @@ pub async fn op_global_timer( // since the start time of the deno runtime. // If the High precision flag is not set, the // nanoseconds are rounded on 2ms. -#[allow(clippy::unnecessary_wraps)] pub fn op_now<TP>( state: &mut OpState, _argument: (), @@ -176,7 +173,6 @@ where Ok(result) } -#[allow(clippy::unnecessary_wraps)] pub fn op_sleep_sync<TP>( state: &mut OpState, millis: u64, diff --git a/runtime/metrics.rs b/runtime/metrics.rs index aabe953d0..22b037a1e 100644 --- a/runtime/metrics.rs +++ b/runtime/metrics.rs @@ -25,7 +25,6 @@ struct MetricsReturn { ops: Value, } -#[allow(clippy::unnecessary_wraps)] fn op_metrics( state: &mut OpState, _args: (), diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs index a80eeb3ac..cd93d0517 100644 --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -350,7 +350,6 @@ async fn op_fstat_async( Ok(get_stat(metadata)) } -#[allow(clippy::unnecessary_wraps)] fn op_umask( state: &mut OpState, mask: Option<u32>, diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 2a72625d9..b3dfb5aab 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -56,7 +56,6 @@ impl Resource for SignalStreamResource { } #[cfg(unix)] -#[allow(clippy::unnecessary_wraps)] fn op_signal_bind( state: &mut OpState, signo: i32, diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index e3ede869d..39aa2c0a9 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -57,7 +57,6 @@ async fn op_worker_get_message( Ok(maybe_data.unwrap_or_else(ZeroCopyBuf::empty)) } -#[allow(clippy::unnecessary_wraps)] fn op_worker_close(state: &mut OpState, _: (), _: ()) -> Result<(), AnyError> { // Notify parent that we're finished let mut handle = state.borrow_mut::<WebWorkerInternalHandle>().clone(); @@ -71,7 +70,6 @@ fn op_worker_close(state: &mut OpState, _: (), _: ()) -> Result<(), AnyError> { /// this same op to pass the error to its own parent (in case /// `e.preventDefault()` was not called in `worker.onerror`). This /// is done until the error reaches the root/ main worker. -#[allow(clippy::unnecessary_wraps)] fn op_worker_unhandled_error( state: &mut OpState, message: String, diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index a5698fa6e..57d3ac2b8 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -509,7 +509,6 @@ fn op_create_worker( Ok(worker_id) } -#[allow(clippy::unnecessary_wraps)] fn op_host_terminate_worker( state: &mut OpState, id: WorkerId, diff --git a/test_plugin/src/lib.rs b/test_plugin/src/lib.rs index 0626ef3c3..88761edcf 100644 --- a/test_plugin/src/lib.rs +++ b/test_plugin/src/lib.rs @@ -86,7 +86,6 @@ impl Resource for TestResource { } } -#[allow(clippy::unnecessary_wraps)] fn op_test_resource_table_add( state: &mut OpState, text: String, |