Skip to content

Commit

Permalink
Set clippy warnings to fail the CI (#128)
Browse files Browse the repository at this point in the history
* Set clippy warnings to fail the CI

* Modify RUSTFLAGS environment variable

* Remove unused comments

* Add missing clippy command-line argument

* Remove unnecessary map

* Fix failing build
  • Loading branch information
MaarifaMaarifa authored Dec 30, 2023
1 parent 1b18f85 commit 6cfa44c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUSTFLAGS: "-D warnings -C opt-level=0"

jobs:

Expand All @@ -19,4 +19,4 @@ jobs:
build:
name: Run build
uses: ./.github/workflows/run-build.yml


5 changes: 0 additions & 5 deletions .github/workflows/run-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Run Build
on:
workflow_call:

# since opt-level of 3 is used for dependencies in dev profile as
# configured through Cargo.toml, we explicitly set it to 0
env:
RUSTFLAGS: "-C opt-level=0"

jobs:
build:
strategy:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Run Tests and Linters
on:
workflow_call:

# since opt-level of 3 is used for dependencies in dev profile as
# configured through Cargo.toml, we explicitly set it to 0
env:
RUSTFLAGS: "-C opt-level=0"

jobs:
fmt:
name: Run rustfmt in check mode
Expand Down Expand Up @@ -54,6 +49,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

spell-check:
name: Run spell check
Expand Down
5 changes: 1 addition & 4 deletions src/gui/tabs/statistics_tab/mini_widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,7 @@ pub fn genre_stats(series_infos: Vec<&SeriesMainInformation>) -> Element<'_, Mes
})
});

let mut genre_count: Vec<(Genre, usize)> = genre_count
.into_iter()
.map(|(genre, count)| (genre, count))
.collect();
let mut genre_count: Vec<(Genre, usize)> = genre_count.into_iter().collect();

genre_count.sort_unstable_by(|a, b| b.1.cmp(&a.1));

Expand Down

0 comments on commit 6cfa44c

Please sign in to comment.