From b3c29cce6a19cbf4a4cbf744bc1f061699431b62 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 28 Feb 2024 16:15:12 +0100 Subject: [PATCH] Fix Clippy --- benches/benchmark.rs | 1 + src/time/js.rs | 5 +++++ tests/util/web.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/benches/benchmark.rs b/benches/benchmark.rs index 549687c..a0bb4b9 100644 --- a/benches/benchmark.rs +++ b/benches/benchmark.rs @@ -14,6 +14,7 @@ fn main() { clippy::min_ident_chars, clippy::unwrap_used )] +#[allow(unknown_lints, clippy::incompatible_msrv)] fn main() { use std::time::Duration; use std::{array, hint}; diff --git a/src/time/js.rs b/src/time/js.rs index ad7dbcb..fe36681 100644 --- a/src/time/js.rs +++ b/src/time/js.rs @@ -5,16 +5,21 @@ use wasm_bindgen::{JsCast, JsValue}; #[wasm_bindgen] extern "C" { + /// Type for the [global object](https://developer.mozilla.org/en-US/docs/Glossary/Global_object). type Global; + /// Returns the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance) object. #[wasm_bindgen(method, getter)] fn performance(this: &Global) -> JsValue; + /// Type for the [`Performance` object](https://developer.mozilla.org/en-US/docs/Web/API/Performance). pub(super) type Performance; + /// Binding to [`Performance.now()`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now). #[wasm_bindgen(method)] pub(super) fn now(this: &Performance) -> f64; + /// Binding to [`Performance.timeOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin). #[cfg(target_feature = "atomics")] #[wasm_bindgen(method, getter, js_name = timeOrigin)] pub(super) fn time_origin(this: &Performance) -> f64; diff --git a/tests/util/web.rs b/tests/util/web.rs index e8f2499..24b3899 100644 --- a/tests/util/web.rs +++ b/tests/util/web.rs @@ -40,6 +40,9 @@ pub(crate) fn sleep(duration: Duration) -> Sleep { #[cfg(target_feature = "atomics")] thread_local! { /// Cached [`Global`]. + #[allow(clippy::empty_docs, non_local_definitions)] + // https://github.com/rust-lang/rust/issues/120363 + // https://github.com/rust-lang/rust/issues/121621 static GLOBAL: Global = { #[wasm_bindgen] extern "C" {