summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2022-09-19 10:25:03 +0200
committerGitHub <noreply@github.com>2022-09-19 10:25:03 +0200
commitb1b418b81a13ede548273665e83c1bc5a97dffcd (patch)
tree731efb5a2811e1d925e94e9a8a16c220ac98de92 /cli/tools
parenta4a894fa1e933e8a678f8ad4f6353837859b02fd (diff)
chore: fix clippy warnings (#15944)
Stop allowing clippy::derive-partial-eq-without-eq and fix warnings about deriving PartialEq without also deriving Eq. In one case I removed the PartialEq because it a) wasn't necessary, and b) sketchy because it was comparing floating point numbers. IMO, that's a good argument for enforcing the lint rule, because it would most likely have been caught during review if it had been enabled.
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/bench.rs6
-rw-r--r--cli/tools/test.rs10
2 files changed, 9 insertions, 7 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs
index ccff3d615..55e98a8b9 100644
--- a/cli/tools/bench.rs
+++ b/cli/tools/bench.rs
@@ -41,7 +41,7 @@ struct BenchSpecifierOptions {
filter: Option<String>,
}
-#[derive(Debug, Clone, PartialEq, Deserialize)]
+#[derive(Debug, Clone, Eq, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BenchPlan {
pub total: usize,
@@ -60,7 +60,7 @@ pub enum BenchEvent {
Result(usize, BenchResult),
}
-#[derive(Debug, Clone, PartialEq, Deserialize)]
+#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum BenchResult {
Ok(BenchStats),
@@ -84,7 +84,7 @@ pub struct BenchDescription {
pub group: Option<String>,
}
-#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BenchStats {
pub n: u64,
pub min: f64,
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index cb5b41042..dca140445 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -59,7 +59,7 @@ use tokio::sync::mpsc::unbounded_channel;
use tokio::sync::mpsc::UnboundedSender;
/// The test mode is used to determine how a specifier is to be tested.
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, Eq, PartialEq)]
pub enum TestMode {
/// Test as documentation, type-checking fenced code blocks.
Documentation,
@@ -144,13 +144,14 @@ impl TestDescription {
}
}
-#[derive(Debug, Clone, PartialEq, Deserialize)]
+#[derive(Debug, Clone, Eq, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum TestOutput {
String(String),
Bytes(Vec<u8>),
}
+#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, Clone, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum TestResult {
@@ -160,7 +161,7 @@ pub enum TestResult {
Cancelled,
}
-#[derive(Debug, Clone, PartialEq, Deserialize)]
+#[derive(Debug, Clone, Eq, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TestStepDescription {
pub id: usize,
@@ -183,6 +184,7 @@ impl TestStepDescription {
}
}
+#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, Clone, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum TestStepResult {
@@ -202,7 +204,7 @@ impl TestStepResult {
}
}
-#[derive(Debug, Clone, PartialEq, Deserialize)]
+#[derive(Debug, Clone, Eq, PartialEq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TestPlan {
pub origin: String,