Skip to content

Commit

Permalink
clippy: switch to warn as error (#179)
Browse files Browse the repository at this point in the history
* switch to warn as error

* Should be all the remaining fixes.
  • Loading branch information
gbin authored Dec 22, 2024
1 parent 9e38943 commit 3d58f92
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ jobs:
# This is also relatively quick to do, so let's fail early.
- name: Run clippy in debug
if: runner.os == 'Linux'
run: cargo clippy --workspace --all-targets -- -W warning
run: cargo clippy --workspace --all-targets -- --deny warnings

- name: Run clippy in release
if: runner.os == 'Linux'
run: cargo clippy --release --workspace --all-targets -- -W warning
run: cargo clippy --release --workspace --all-targets -- --deny warnings

- name: Install cargo-generate
run: cargo install cargo-generate
Expand Down
2 changes: 1 addition & 1 deletion components/payloads/cu_sensor_payloads/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ mod tests {
let mut encoded = vec![0u8; 1024]; // Reserve a buffer with sufficient capacity

let length =
bincode::encode_into_slice(&a, &mut encoded, bincode::config::standard()).unwrap();
bincode::encode_into_slice(a, &mut encoded, bincode::config::standard()).unwrap();
assert_eq!(length, 4);
}
}
8 changes: 3 additions & 5 deletions components/tasks/cu_aligner/src/buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ macro_rules! alignment_buffers {
.min();

// If there is no data in any of the buffers, return early
if most_recent_time.is_none() {
return None;
}
most_recent_time?;

let most_recent_time = most_recent_time.unwrap();

Expand Down Expand Up @@ -184,11 +182,11 @@ mod tests {
buffers.buffer1.inner.push_back(msg1.clone());
buffers.buffer2.inner.push_back(msg1);
// within the horizon
let _ = buffers.purge(Duration::from_secs(2).into());
buffers.purge(Duration::from_secs(2).into());
assert_eq!(buffers.buffer1.inner.len(), 1);
assert_eq!(buffers.buffer2.inner.len(), 1);
// outside the horizon
let _ = buffers.purge(Duration::from_secs(5).into());
buffers.purge(Duration::from_secs(5).into());
assert_eq!(buffers.buffer1.inner.len(), 0);
assert_eq!(buffers.buffer2.inner.len(), 0);
}
Expand Down
6 changes: 3 additions & 3 deletions core/cu29_runtime/src/copperlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ mod tests {
assert_eq!(q.len(), 3);

let mut iter = q.iter();
iter.next().unwrap().msgs;
iter.next().unwrap().msgs;
iter.next().unwrap().msgs;
iter.next().unwrap();
iter.next().unwrap();
iter.next().unwrap();
assert!(iter.next().is_none());
}

Expand Down

0 comments on commit 3d58f92

Please sign in to comment.