diff --git a/influxdb_iox_client/src/client/management.rs b/influxdb_iox_client/src/client/management.rs index d197f6b90e..b8dbaeac76 100644 --- a/influxdb_iox_client/src/client/management.rs +++ b/influxdb_iox_client/src/client/management.rs @@ -474,8 +474,8 @@ impl Client { self.inner .new_partition_chunk(NewPartitionChunkRequest { db_name, - table_name, partition_key, + table_name, }) .await .map_err(|status| match status.code() { diff --git a/influxdb_tsm/src/reader.rs b/influxdb_tsm/src/reader.rs index 03bc48497c..54a730b4dc 100644 --- a/influxdb_tsm/src/reader.rs +++ b/influxdb_tsm/src/reader.rs @@ -459,6 +459,7 @@ impl BlockData { /// overwrites previous values. Therefore, in order to have "last write /// wins" semantics it is important that the provided vector of blocks /// is ordered by the wall-clock time the blocks were created. + #[allow(clippy::manual_flatten)] // https://github.com/rust-lang/rust-clippy/issues/6784 pub fn merge(mut blocks: Vec) -> Self { if blocks.is_empty() { panic!("merge called with zero blocks"); diff --git a/internal_types/src/arrow/sort.rs b/internal_types/src/arrow/sort.rs index 4bdeb78ace..e57578070a 100644 --- a/internal_types/src/arrow/sort.rs +++ b/internal_types/src/arrow/sort.rs @@ -36,7 +36,7 @@ pub type Result = std::result::Result; /// pub fn estimate_cardinality(array: &DictionaryArray) -> usize { let keys = array.keys(); - let group: HashSet<_> = keys.iter().filter_map(|x| x).collect(); + let group: HashSet<_> = keys.iter().flatten().collect(); group.len() } diff --git a/metrics/src/lib.rs b/metrics/src/lib.rs index fef5d343b2..1aa4cc59a9 100644 --- a/metrics/src/lib.rs +++ b/metrics/src/lib.rs @@ -162,11 +162,9 @@ impl Domain { suffix: Option<&str>, ) -> String { let mut ret = self.name.to_string(); - for s in &[subname, Some(metric_name), unit, suffix] { - if let Some(s) = s { - ret.push('.'); - ret.push_str(s) - } + for s in [subname, Some(metric_name), unit, suffix].iter().flatten() { + ret.push('.'); + ret.push_str(s); } ret } diff --git a/metrics/src/metrics.rs b/metrics/src/metrics.rs index 062144f4b6..bb01facbeb 100644 --- a/metrics/src/metrics.rs +++ b/metrics/src/metrics.rs @@ -71,9 +71,9 @@ impl Display for RedRequestStatus { /// Using a `REDMetric` makes following this methodology easy because it handles /// updating the three components for you. pub struct RedMetric { - default_labels: Vec, requests: OTCounter, duration: OTHistogram, + default_labels: Vec, } impl RedMetric { @@ -370,8 +370,8 @@ impl Gauge { /// A Histogram is a metric exposing a distribution of observations. #[derive(Debug)] pub struct Histogram { - default_labels: Vec, histogram: OTHistogram, + default_labels: Vec, } impl Histogram { diff --git a/query/src/exec/seriesset.rs b/query/src/exec/seriesset.rs index 3eb03e4d7f..1d47a7ac19 100644 --- a/query/src/exec/seriesset.rs +++ b/query/src/exec/seriesset.rs @@ -348,11 +348,8 @@ impl SeriesSetConverter { batch.schema().fields()[*column_index] ), }; - if let Some(tag_value) = tag_value { - Some((Arc::clone(&column_name), Arc::from(tag_value.as_str()))) - } else { - None - } + + tag_value.map(|tag_value| (Arc::clone(&column_name), Arc::from(tag_value.as_str()))) }) .collect() } diff --git a/rust-toolchain b/rust-toolchain index d2d62553b3..d4f820371f 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.51.0 \ No newline at end of file +1.52.0 \ No newline at end of file diff --git a/server/src/db.rs b/server/src/db.rs index 8e5e31a944..1e3931e5da 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -158,9 +158,9 @@ pub enum Error { source ))] ReadBufferChunkTimestampError { - chunk_id: u32, - table_name: String, source: read_buffer::Error, + table_name: String, + chunk_id: u32, }, #[snafu(display("Error writing to object store: {}", source))]