Skip to content

Commit

Permalink
Fix Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Feb 28, 2024
1 parent 62c33fb commit b3c29cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
5 changes: 5 additions & 0 deletions src/time/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions tests/util/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit b3c29cc

Please sign in to comment.