Skip to content

Commit be94e5d

Browse files
committed
Fix clippy config
Denying all warnings for test builds results in a poor development experience, as everying always appears as an error in the editor. The program might still compile and run fine though. At the same time, CI only denies rustc's warnings, not those of clippy. So code that gets marked as an error in an editor can still pass CI. Both of these issues are fixed by running clippy in CI explicitly.
1 parent 5738294 commit be94e5d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
IFS=$'\n\t'
2121
# Check if the code is good
2222
cargo build --all --locked
23+
cargo clippy -- --deny warnings
2324
cargo test --all --locked
2425
2526
- name: Build the Docker image

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(test, deny(warnings))]
2-
31
#[macro_use]
42
extern crate lazy_static;
53
extern crate rand;
@@ -284,6 +282,7 @@ fn redirect_bare_en_us() -> Redirect {
284282
}
285283

286284
#[catch(404)]
285+
#[allow(clippy::result_large_err)]
287286
fn not_found(req: &Request) -> Result<Template, Redirect> {
288287
if let Some(redirect) = crate::redirect::maybe_redirect(req.uri().path()) {
289288
return Err(redirect);

src/teams.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl Data {
155155
let mut subteams = Vec::with_capacity(raw_subteams.len());
156156
lay_out_subteams_hierarchically(&mut subteams, None, &main_team.name, &raw_subteams);
157157

158-
fn lay_out_subteams_hierarchically<'a>(
158+
fn lay_out_subteams_hierarchically(
159159
result: &mut Vec<Team>,
160160
team: Option<&Team>,
161161
main_team: &str,

0 commit comments

Comments
 (0)