refactor: apply extra clippy lints suggestions (#673)

Cherry picking of lints from clippy::pedantic / clippy::nursery / clippy::unwrap_used / clippy::expect_used

Notable changes :
- consideration of all clippy::use-self lints
- replaced sort() by unstable_sort()
- use of map_or_else() when appropriate 
- replaced "".to_string() by String::new()
- replaced collect() + len() by count()

The code base now passes all the clippy::nursery lints

---------
Co-authored-by: w1nst0n <w1nst0n@keemail.me>
This commit is contained in:
Amaan Qureshi 2023-04-10 05:33:12 -04:00 committed by GitHub
commit 68092ff987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 421 additions and 395 deletions

View file

@ -25,9 +25,9 @@ jobs:
- graphics: glow
renderer: "-opengl"
- graphics: wgpu
renderer: '' # Vulkan but we don't want this in the binary filename
renderer: "" # Vulkan but we don't want this in the binary filename
- update_feature: self-update
update_name: '' # we don't want this in the binary filename
update_name: "" # we don't want this in the binary filename
- update_feature: no-self-update
update_name: "-noseflupdate"
steps:
@ -62,4 +62,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: uad_gui${{ matrix.update_name }}-${{ matrix.build_target }}${{ matrix.renderer }}
path: bin/uad_gui-*
path: bin/uad_gui-*

View file

@ -2,16 +2,16 @@ name: Continuous Integration
on:
push:
paths:
- '**.rs'
- 'Cargo.lock'
- 'Cargo.toml'
- '**.json'
- "**.rs"
- "Cargo.lock"
- "Cargo.toml"
- "**.json"
pull_request:
paths:
- '**.rs'
- 'Cargo.lock'
- 'Cargo.toml'
- '**.json'
- "**.rs"
- "Cargo.lock"
- "Cargo.toml"
- "**.json"
jobs:
lint:
@ -33,7 +33,7 @@ jobs:
- lint: check
args: " --all-features"
- lint: test
args: ''
args: ""
- lint: clippy
args: " --all --all-features -- -D warnings"
- lint: fmt

View file

@ -5,9 +5,9 @@ on:
branches:
- main
paths:
- '**.rs'
- 'Cargo.lock'
- 'Cargo.toml'
- "**.rs"
- "Cargo.lock"
- "Cargo.toml"
tags-ignore:
- dev-build