Skip to content

Commit 984aa76

Browse files
chore(dev): bump rust toolchain to 1.95 and fix clippy lints (#25606)
* chore: bump rust toolchain to 1.95 and fix clippy lints * fix(websocket sink): handle Auth::Bearer match exhaustiveness without aws-core * Add HTTP Version fallback --------- Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
1 parent dcd4f03 commit 984aa76

22 files changed

Lines changed: 54 additions & 63 deletions

File tree

lib/codecs/tests/native.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn rebuild_proto_fixtures() {
202202
fn fixtures_match(suffix: &str) {
203203
let json_entries = list_fixtures("json", suffix);
204204
let proto_entries = list_fixtures("proto", suffix);
205-
for (json_path, proto_path) in json_entries.into_iter().zip(proto_entries.into_iter()) {
205+
for (json_path, proto_path) in json_entries.into_iter().zip(proto_entries) {
206206
// Make sure we're looking at the matching files for each format
207207
assert_eq!(
208208
json_path.file_stem().unwrap(),
@@ -220,7 +220,7 @@ fn decoding_matches(suffix: &str) {
220220
let json_entries = list_fixtures("json", suffix);
221221
let proto_entries = list_fixtures("proto", suffix);
222222

223-
for (json_path, proto_path) in json_entries.into_iter().zip(proto_entries.into_iter()) {
223+
for (json_path, proto_path) in json_entries.into_iter().zip(proto_entries) {
224224
let (_, json_event) = load_deserialize(&json_path, &json_deserializer);
225225

226226
let (_, proto_event) = load_deserialize(&proto_path, &proto_deserializer);

lib/vector-buffers/src/variants/disk_v2/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ where
339339
if max_record_size <= MINIMUM_MAX_RECORD_SIZE {
340340
return Err(BuildError::InvalidParameter {
341341
param_name: "max_record_size",
342-
reason: format!("must be greater than or equal to {MINIMUM_MAX_RECORD_SIZE} bytes",),
342+
reason: format!("must be greater than or equal to {MINIMUM_MAX_RECORD_SIZE} bytes"),
343343
});
344344
}
345345

lib/vector-buffers/src/variants/disk_v2/ledger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ where
471471
);
472472

473473
trace!(
474-
unacked_reader_file_id_offset = result.map(|n| n - 1).unwrap_or(0),
474+
unacked_reader_file_id_offset = result.map_or(0, |n| n - 1),
475475
acked_reader_file_id_offset = new_reader_file_id,
476476
"Incremented acknowledged reader file ID offset with corresponding unacknowledged decrement."
477477
);

lib/vector-config/src/schema/visitors/merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ where
262262
K: Clone + Eq + Ord,
263263
V: Clone + Mergeable,
264264
{
265-
destination.merge(source);
265+
Mergeable::merge(destination, source);
266266
}
267267

268268
fn merge_optional<T: Clone>(destination: &mut Option<T>, source: Option<&T>) {

lib/vector-core/src/config/global_options.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ impl GlobalOptions {
217217
if !data_dir.exists() {
218218
return Err(DataDirError::DoesNotExist { data_dir }.into());
219219
}
220-
let readonly = std::fs::metadata(&data_dir)
221-
.map(|meta| meta.permissions().readonly())
222-
.unwrap_or(true);
220+
let readonly =
221+
std::fs::metadata(&data_dir).map_or(true, |meta| meta.permissions().readonly());
223222
if readonly {
224223
return Err(DataDirError::NotWritable { data_dir }.into());
225224
}

lib/vector-core/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn fmt_helper(
197197
data_type: DataType,
198198
) -> fmt::Result {
199199
match maybe_port {
200-
Some(port) => write!(f, "port: \"{port}\",",),
200+
Some(port) => write!(f, "port: \"{port}\","),
201201
None => write!(f, "port: None,"),
202202
}?;
203203
write!(f, " types: {data_type}")

lib/vector-core/src/event/lua/metric.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl IntoLua for LuaMetric {
163163
}
164164
MetricValue::Set { values } => {
165165
let set = lua.create_table()?;
166-
set.raw_set("values", lua.create_sequence_from(values.into_iter())?)?;
166+
set.raw_set("values", lua.create_sequence_from(values)?)?;
167167
tbl.raw_set("set", set)?;
168168
}
169169
MetricValue::Distribution { samples, statistic } => {

lib/vector-core/src/event/metadata.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,8 @@ impl EventMetadata {
381381

382382
// Keep the earliest `last_transform_timestamp` for accurate latency measurement.
383383
match (self.last_transform_timestamp, other_timestamp) {
384-
(Some(self_ts), Some(other_ts)) => {
385-
if other_ts < self_ts {
386-
self.last_transform_timestamp = Some(other_ts);
387-
}
384+
(Some(self_ts), Some(other_ts)) if other_ts < self_ts => {
385+
self.last_transform_timestamp = Some(other_ts);
388386
}
389387
(None, Some(other_ts)) => {
390388
self.last_transform_timestamp = Some(other_ts);

lib/vector-core/src/event/metric/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ impl Metric {
334334
/// Returns `true` if `name` tag is present, and matches the provided `value`
335335
pub fn tag_matches(&self, name: &str, value: &str) -> bool {
336336
self.tags()
337-
.filter(|t| t.get(name).filter(|v| *v == value).is_some())
338-
.is_some()
337+
.as_ref()
338+
.is_some_and(|t| t.get(name).as_ref().is_some_and(|v| *v == value))
339339
}
340340

341341
/// Returns the string value of a tag, if it exists

lib/vector-core/src/metrics/ddsketch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl AgentDDSketch {
407407

408408
fn insert_key_counts(&mut self, mut counts: Vec<(i16, u32)>) {
409409
// Counts need to be sorted by key.
410-
counts.sort_unstable_by(|(k1, _), (k2, _)| k1.cmp(k2));
410+
counts.sort_unstable_by_key(|(k1, _)| *k1);
411411

412412
let mut temp = Vec::new();
413413

0 commit comments

Comments
 (0)