Skip to content

Commit

Permalink
Merge branch 'master' into nagisa/version-bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmih committed Aug 10, 2023
2 parents 1964f7c + 928d8a9 commit aaeeb37
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
64 changes: 21 additions & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,43 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
name: Setup rust toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
name: Load dependencies from cache

- uses: actions-rs/cargo@v1
name: Build with stable features
with:
command: build
args: --features stable
- name: Build with stable features
run: cargo build --features stable

- uses: actions-rs/cargo@v1
- name: Build with unstable features
if: ${{ matrix.rust == 'nightly' }}
name: Build with unstable features
with:
command: build
args: --all-features
run: cargo build --all-features

- uses: actions-rs/cargo@v1
name: Build with minimal features
with:
command: build
args: --no-default-features
- name: Build with minimal features
run: cargo build --no-default-features

- uses: actions-rs/cargo@v1
name: Test with stable features
with:
command: test
args: --features stable
- name: Test with stable features
run: cargo test --features stable

- uses: actions-rs/cargo@v1
name: Test with minimal features
with:
command: test
args: --no-default-features
- name: Test with minimal features
run: cargo test --no-default-features

- uses: actions-rs/cargo@v1
name: Check for non-standard formatting
- name: Check for non-standard formatting
if: ${{ matrix.rust == 'stable' }}
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- uses: actions-rs/cargo@v1
name: Check for clippy hints
- name: Check for clippy hints
if: ${{ matrix.rust == 'stable' }}
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings

# This fails on 1.64, but works on 1.66 and later.
# https://github.com/rust-lang/rust/issues/103306
- name: Test run targeting WASI
if: ${{ matrix.rust == 'stable' }}
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
source ~/.bashrc
Expand All @@ -97,16 +77,14 @@ jobs:
- stable

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2

- uses: taiki-e/install-action@nextest

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ serde_json = "1.0"
serde_derive = "1.0"
ciborium = "0.2.0"
is-terminal = "0.4.6"
clap = { version = "4", default-features = false, features = ["std"] }
clap = { version = "4", default-features = false, features = ["std", "help"] }
walkdir = "2.3"
tinytemplate = "1.1"
cast = "0.3"
Expand Down
6 changes: 3 additions & 3 deletions book/src/user_guide/comparing_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ graphs to show the differences in performance between them. First, lets create a
benchmark. We can even combine this with benchmarking over a range of inputs.

```rust
use criterion::{criterion_group, criterion_main, Criterion, BenchmarkId};
use criterion::{black_box, criterion_group, criterion_main, Criterion, BenchmarkId};

fn fibonacci_slow(n: u64) -> u64 {
match n {
Expand Down Expand Up @@ -55,9 +55,9 @@ fn bench_fibs(c: &mut Criterion) {
let mut group = c.benchmark_group("Fibonacci");
for i in [20u64, 21u64].iter() {
group.bench_with_input(BenchmarkId::new("Recursive", i), i,
|b, i| b.iter(|| fibonacci_slow(*i)));
|b, i| b.iter(|| fibonacci_slow(black_box(*i))));
group.bench_with_input(BenchmarkId::new("Iterative", i), i,
|b, i| b.iter(|| fibonacci_fast(*i)));
|b, i| b.iter(|| fibonacci_fast(black_box(*i))));
}
group.finish();
}
Expand Down
2 changes: 0 additions & 2 deletions plot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ num-complex = { version = "0.4", default-features = false, features = ["std"] }
rand = "0.8"

[badges]
travis-ci = { repository = "bheisler/criterion.rs" }
appveyor = { repository = "bheisler/criterion.rs", id = "4255ads9ctpupcl2" }
maintenance = { status = "looking-for-maintainer" }
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,11 @@ impl<M: Measurement> Criterion<M> {
.num_args(0)
.hide(true)
.help("Ignored, but added for compatibility with libtest."))
.arg(Arg::new("include-ignored")
.long("include-ignored")
.num_args(0)
.hide(true)
.help("Ignored, but added for compatibility with libtest."))
.arg(Arg::new("version")
.hide(true)
.short('V')
Expand Down

0 comments on commit aaeeb37

Please sign in to comment.