Skip to content

Commit

Permalink
Add bench command
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 26, 2023
1 parent 819d951 commit 78807aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
precommit:
@bash .githooks/pre-push

bench:
RUSTFLAGS='--cfg=bench' cargo +nightly bench -p nostr

clean:
cargo clean

Expand Down
4 changes: 4 additions & 0 deletions crates/nostr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#![warn(missing_docs)]
#![warn(rustdoc::bare_urls)]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(bench, feature(test))]
//#![cfg_attr(all(not(feature = "std"), feature = "alloc"), feature(error_in_core))]
#![cfg_attr(
feature = "default",
Expand All @@ -16,6 +17,9 @@
#[cfg(not(any(feature = "std", feature = "alloc")))]
compile_error!("at least one of the `std` or `alloc` features must be enabled");

#[cfg(bench)]
extern crate test;

#[cfg(feature = "std")]
#[macro_use]
extern crate std;
Expand Down

0 comments on commit 78807aa

Please sign in to comment.