From 5cda3d665cc568fa1cb9f6234b6d18cf5c10a784 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Mon, 24 Aug 2020 10:40:07 -0700 Subject: [PATCH 1/2] src: fix clippy warnings This should unblock CI on main. --- src/trace/server_timing/metric.rs | 1 + src/trace/server_timing/parse.rs | 2 +- src/utils/date.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trace/server_timing/metric.rs b/src/trace/server_timing/metric.rs index bf4f8fee..ed55c189 100644 --- a/src/trace/server_timing/metric.rs +++ b/src/trace/server_timing/metric.rs @@ -80,6 +80,7 @@ mod test { use std::time::Duration; #[test] + #[allow(clippy::redundant_clone)] fn encode() -> crate::Result<()> { let name = String::from("Server"); let dur = Duration::from_secs(1); diff --git a/src/trace/server_timing/parse.rs b/src/trace/server_timing/parse.rs index af14936b..b37e81e6 100644 --- a/src/trace/server_timing/parse.rs +++ b/src/trace/server_timing/parse.rs @@ -175,7 +175,7 @@ mod test { fn assert_entry(s: &str, n: &str, du: Option, de: Option<&str>) -> crate::Result<()> { let e = parse_entry(s)?; assert_eq!(e.name(), n); - assert_eq!(e.duration(), du.map(|du| Duration::from_millis(du))); + assert_eq!(e.duration(), du.map(Duration::from_millis)); assert_eq!(e.description(), de); Ok(()) } diff --git a/src/utils/date.rs b/src/utils/date.rs index 6db504e9..27934f47 100644 --- a/src/utils/date.rs +++ b/src/utils/date.rs @@ -16,7 +16,7 @@ const SECONDS_IN_HOUR: u64 = 3600; /// Format using the `Display` trait. /// Convert timestamp into/from `SytemTime` to use. /// Supports comparison and sorting. -#[derive(Copy, Clone, Debug, Eq, Ord)] +#[derive(Copy, Clone, Debug, Eq)] pub(crate) struct HttpDate { /// 0...59 second: u8, From 3e35fca3676022724c69c6f28983422c4d76506a Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Tue, 25 Aug 2020 10:32:27 -0700 Subject: [PATCH 2/2] ci: add tests and examples to clippy Same as Tide. See comments in https://github.com/http-rs/http-types/pull/234 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e459e66f..d159ced7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: -- -D warnings + args: --tests --examples -- -D warnings - name: tests uses: actions-rs/cargo@v1