chore: Update Rust version (#1445)
* chore: Update Rust version * refactor: Make struct constructor field orderings consistent Sometimes I changed the struct definition, sometimes changed the struct construction instance, depending on consistency with code around each (other similar structs, function argument orders, etc) More info: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor * refactor: Use flatten where appropriate One instance is a false positive with a clippy bug. More info: - https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity - https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten * refactor: Use Option map instead of match More info: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/24376/head
parent
15831a4e75
commit
febc1538ff
|
@ -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() {
|
||||
|
|
|
@ -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>) -> Self {
|
||||
if blocks.is_empty() {
|
||||
panic!("merge called with zero blocks");
|
||||
|
|
|
@ -36,7 +36,7 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
|
|||
///
|
||||
pub fn estimate_cardinality(array: &DictionaryArray<Int32Type>) -> usize {
|
||||
let keys = array.keys();
|
||||
let group: HashSet<_> = keys.iter().filter_map(|x| x).collect();
|
||||
let group: HashSet<_> = keys.iter().flatten().collect();
|
||||
group.len()
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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<KeyValue>,
|
||||
requests: OTCounter<u64>,
|
||||
duration: OTHistogram<f64>,
|
||||
default_labels: Vec<KeyValue>,
|
||||
}
|
||||
|
||||
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<KeyValue>,
|
||||
histogram: OTHistogram<f64>,
|
||||
default_labels: Vec<KeyValue>,
|
||||
}
|
||||
|
||||
impl Histogram {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.51.0
|
||||
1.52.0
|
|
@ -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))]
|
||||
|
|
Loading…
Reference in New Issue