diff --git a/providers/cloudwatch/src/types/api/paginate.rs b/providers/cloudwatch/src/types/api/paginate.rs index 53ad0f2..9f6e301 100644 --- a/providers/cloudwatch/src/types/api/paginate.rs +++ b/providers/cloudwatch/src/types/api/paginate.rs @@ -8,7 +8,7 @@ use std::collections::{BTreeMap, HashMap}; pub trait Paginate: Into> { /// 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) -> Option; } diff --git a/providers/https/src/lib.rs b/providers/https/src/lib.rs index bfb9c0c..16534c9 100644 --- a/providers/https/src/lib.rs +++ b/providers/https/src/lib.rs @@ -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); diff --git a/providers/prometheus/src/timeseries.rs b/providers/prometheus/src/timeseries.rs index 8061ecf..4c5a95e 100644 --- a/providers/prometheus/src/timeseries.rs +++ b/providers/prometheus/src/timeseries.rs @@ -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; @@ -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()) } }