Skip to content

Commit 211ebc4

Browse files
autofix (#314)
* autofix * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 932bb7a commit 211ebc4

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.github/workflows/autofix.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: autofix.ci
2+
on:
3+
workflow_call:
4+
pull_request:
5+
push:
6+
branches: [ "main" ]
7+
permissions:
8+
contents: read
9+
10+
11+
jobs:
12+
autofix:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/cache@v4
17+
with:
18+
path: |
19+
~/.cargo/bin/
20+
~/.cargo/registry/index/
21+
~/.cargo/registry/cache/
22+
~/.cargo/git/db/
23+
target/
24+
key: autofix-${{ hashFiles('**/Cargo.lock') }}
25+
26+
- run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy
27+
- run: rustup default stable
28+
29+
- run: cargo clippy --fix --workspace
30+
- run: cargo fmt --all
31+
32+
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef

benches/simulation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn parallel_simulate(config: &SimulatorConfig) -> Result<Vec<f32>, FS
1414
cost_per_day,
1515
..
1616
} = simulate(
17-
&config,
17+
config,
1818
&DEFAULT_PARAMETERS,
1919
i as f32 / 100.0,
2020
Some((i + 42).try_into().unwrap()),

src/optimal_retention.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ mod tests {
13241324

13251325
#[test]
13261326
fn simulate_returns_cards() -> Result<()> {
1327-
let w = DEFAULT_PARAMETERS.clone();
1327+
let w = DEFAULT_PARAMETERS;
13281328

13291329
let config = SimulatorConfig {
13301330
deck_size: 1,
@@ -1381,7 +1381,7 @@ mod tests {
13811381

13821382
#[test]
13831383
fn learn_does_not_affect_correct_count() -> Result<()> {
1384-
let mut w = DEFAULT_PARAMETERS.clone();
1384+
let mut w = DEFAULT_PARAMETERS;
13851385
w[3] = 10000.;
13861386

13871387
let config = SimulatorConfig {

0 commit comments

Comments
 (0)