Skip to content

Commit

Permalink
Fix clippies 2024-05-03 (#76)
Browse files Browse the repository at this point in the history
* cargo clippy --fix

* Resolve more clippies
  • Loading branch information
hatchan authored May 3, 2024
1 parent 33dab0d commit 299e051
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion providers/cloudwatch/src/types/api/paginate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::{BTreeMap, HashMap};
pub trait Paginate: Into<CanonicalRequest<{ request_state::STEM }>> {
/// Forge a subsequent request for the next page.
/// Return None if the pagination_token is absent or empty.
#[must_use("nothing will happen unless this request is sent by a client.")]
#[must_use = "nothing will happen unless this request is sent by a client."]
fn next_page(self, pagination_token: Option<String>) -> Option<Self>;
}

Expand Down
2 changes: 1 addition & 1 deletion providers/https/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async fn send_query(
log(format!("Sending {method:?} request to {url}"));

let mut request = HttpRequest::default();
request.url = url.clone();
request.url.clone_from(&url);
request.method = method;
request.headers = Some(headers);
request.body = body.map(|blob| blob.data);
Expand Down
7 changes: 4 additions & 3 deletions providers/prometheus/src/timeseries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use fiberplane_pdk::prelude::*;
use grafana_common::{query_direct_and_proxied, Config};
use serde::Deserialize;
use serde_json::Result as SerdeResult;
use std::fmt::Display;
use std::time::SystemTime;
use time::ext::NumericalDuration;

Expand All @@ -26,9 +27,9 @@ struct StepSize {
unit: StepUnit,
}

impl ToString for StepSize {
fn to_string(&self) -> String {
format!("{}{}", self.amount, self.unit.to_str())
impl Display for StepSize {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}{}", self.amount, self.unit.to_str())
}
}

Expand Down

0 comments on commit 299e051

Please sign in to comment.