Skip to content

Commit

Permalink
Merge pull request #13 from appsignal/clippy
Browse files Browse the repository at this point in the history
Update clippy config in CI
  • Loading branch information
tombruijn authored Oct 3, 2024
2 parents 3139412 + a478eea commit 424c142
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- uses: actions/checkout@v4
- run: cargo build --verbose
- run: cargo test --verbose
- run: cargo clippy --verbose
- run: cargo clippy --verbose --tests --all-targets --all-features -- -D warnings
- run: cargo fmt --verbose
26 changes: 13 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ impl AppsignalMetric {
value.as_f64().map(|value| Self {
name: metric_name.to_string(),
metric_type: "gauge".to_string(),
value: value as f64,
value,
tags,
})
}

pub fn to_key(self) -> AppsignalMetricKey {
AppsignalMetricKey(self)
pub fn to_key(&self) -> AppsignalMetricKey {
AppsignalMetricKey(self.clone())
}
}

Expand Down Expand Up @@ -202,7 +202,7 @@ fn extract_pod_metrics(
}
}

return Some(pod_name.to_owned());
Some(pod_name.to_owned())
}

fn extract_node_metrics(node_results: &Value, out: &mut HashSet<AppsignalMetricKey>) {
Expand Down Expand Up @@ -419,7 +419,7 @@ mod tests {
"cpu": {
"time": "2024-03-29T12:21:36Z",
"usageNanoCores": 232839439,
"usageCoreNanoSeconds": 1118592000000 as u64
"usageCoreNanoSeconds": 1118592000000_u64
},
}),
&mut out,
Expand All @@ -437,7 +437,7 @@ mod tests {
"cpu": {
"time": "2024-03-29T12:21:36Z",
"usageNanoCores": 232839439,
"usageCoreNanoSeconds": 1118592000000 as u64
"usageCoreNanoSeconds": 1118592000000_u64
},
}),
&mut out,
Expand All @@ -457,7 +457,7 @@ mod tests {
AppsignalMetric::new(
"node_cpu_usage_core_nano_seconds",
BTreeMap::from([("node".to_string(), "some_node".to_string())]),
&json!(1118592000000 as u64),
&json!(1118592000000_u64),
)
.expect("Could not create metric"),
);
Expand All @@ -480,7 +480,7 @@ mod tests {
"cpu": {
"time": "2024-03-29T12:21:36Z",
"usageNanoCores": 232839439,
"usageCoreNanoSeconds": 1118592000000 as u64
"usageCoreNanoSeconds": 1118592000000_u64
},
}),
&mut out,
Expand All @@ -500,7 +500,7 @@ mod tests {
"cpu": {
"time": "2024-03-29T12:21:36Z",
"usageNanoCores": 232839439,
"usageCoreNanoSeconds": 1118592000000 as u64
"usageCoreNanoSeconds": 1118592000000_u64
},
}),
&mut out,
Expand All @@ -520,7 +520,7 @@ mod tests {
AppsignalMetric::new(
"pod_cpu_usage_core_nano_seconds",
BTreeMap::from([("pod".to_string(), "some_pod".to_string())]),
&json!(1118592000000 as u64),
&json!(1118592000000_u64),
)
.expect("Could not create metric"),
);
Expand All @@ -542,7 +542,7 @@ mod tests {
extract_volume_metrics(
&json!({
"availableBytes": 232839439,
"capacityBytes": 1118592000000 as u64,
"capacityBytes": 1118592000000_u64,
}),
"some_pod",
&mut out,
Expand All @@ -558,7 +558,7 @@ mod tests {
&json!({
"name": "some_volume",
"availableBytes": 232839439,
"capacityBytes": 1118592000000 as u64,
"capacityBytes": 1118592000000_u64,
}),
"some_pod",
&mut out,
Expand All @@ -585,7 +585,7 @@ mod tests {
("pod".to_string(), "some_pod".to_string()),
("volume".to_string(), "some_volume".to_string()),
]),
&json!(1118592000000 as u64),
&json!(1118592000000_u64),
)
.expect("Could not create metric"),
);
Expand Down

0 comments on commit 424c142

Please sign in to comment.