-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
4,612 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
name: style | ||
on: [push, workflow_dispatch] | ||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/style.yml' | ||
- 'rustfmt.toml' | ||
- '**.rs' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
style: | ||
name: style | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: cargo fmt --check | ||
- run: cargo fmt -v --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Code of Conduct | ||
|
||
Just be cool (optional). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Contributing | ||
|
||
Not accepting pull requests, since this is my personal learning project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use project_euler::utils; | ||
|
||
pub fn is_prime(c: &mut criterion::Criterion) { | ||
c.bench_function("is_prime", |b| { | ||
b.iter(|| (0..10i64.pow(5)).map(utils::is_prime).count()) | ||
}); | ||
} | ||
|
||
pub fn sieve_of_atkin(c: &mut criterion::Criterion) { | ||
c.bench_function("sieve_of_atkin", |b| { | ||
b.iter(|| utils::SieveOfAtkin::new(10usize.pow(6))) | ||
}); | ||
} | ||
|
||
criterion::criterion_group!(benches, is_prime, sieve_of_atkin); | ||
criterion::criterion_main!(benches); |
Oops, something went wrong.