jnioche / carbonintensity-api

A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/
Apache License 2.0
10 stars 1 forks source link

Run clippy in CI, fail if there are warnings #22

Closed xoen closed 1 month ago

xoen commented 1 month ago

This is useful to avoid committing code of subpar quality or potentially wrong.

Example of failed run:

cargo clippy -- -Dwarnings
[...]
Checking carbonintensity-api v0.3.0 (/home/runner/work/carbonintensity-api/carbonintensity-api)
error: constant `UNUSED` is never used
  --> src/lib.rs:11:7
   |
11 | const UNUSED: u8 = 42;
   |       ^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
error: could not compile `carbonintensity-api` (lib) due to 1 previous error
Error: Process completed with exit code 101.