-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): Update Rust toolchain to 1.83.0 #22068
Changes from 12 commits
3a2463a
909b6e0
a5ae269
3fc3a0b
94a60a8
ac15da3
ea5a354
2c0b91f
f0c9b9d
d5c7670
7395ca4
fa7976f
db6ee12
837b933
6d3a48f
0cd2819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ where | |
|
||
struct Visitor<'a>(MutexGuard<'a, String>); | ||
|
||
impl<'a> field::Visit for Visitor<'a> { | ||
impl field::Visit for Visitor<'_> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✨ nice readability improvement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I forgot to leave some comments about the clippy changes, but this was one of them about it being unnecessary to specify lifetimes in some places. |
||
fn record_debug(&mut self, _field: &field::Field, value: &dyn fmt::Debug) { | ||
use std::fmt::Write; | ||
_ = write!(&mut *self.0, "{:?}", value); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ where | |
} | ||
} | ||
|
||
impl<'a, T> EventCount for &'a T | ||
impl<T> EventCount for &T | ||
where | ||
T: EventCount, | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ pub(crate) const fn align16(amount: usize) -> usize { | |
"`amount` must be less than `MAX_ALIGNABLE_AMOUNT`" | ||
); | ||
|
||
((amount + SERIALIZER_ALIGNMENT - 1) / SERIALIZER_ALIGNMENT) * SERIALIZER_ALIGNMENT | ||
amount.div_ceil(SERIALIZER_ALIGNMENT) * SERIALIZER_ALIGNMENT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note (no action need): interesting change, should be covered by existing tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm, yeah, I didn't even notice this one since |
||
} | ||
|
||
/// Gets the maximum possible data file size given the type-level numerical limits and buffer invariants. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,20 @@ use crate::{ | |
EventCount, | ||
}; | ||
|
||
impl AsMetadata for u32 { | ||
fn into_u32(self) -> u32 { | ||
self | ||
} | ||
|
||
fn from_u32(value: u32) -> Option<Self> { | ||
if value < 32 { | ||
Some(value) | ||
} else { | ||
None | ||
} | ||
} | ||
} | ||
|
||
#[tokio::test] | ||
async fn reader_throws_error_when_record_length_delimiter_is_zero() { | ||
with_temp_dir(|dir| { | ||
|
@@ -686,20 +700,6 @@ async fn reader_throws_error_when_record_is_undecodable_via_metadata() { | |
static GET_METADATA_VALUE: AtomicU32 = AtomicU32::new(0); | ||
static CAN_DECODE_VALUE: AtomicU32 = AtomicU32::new(0); | ||
|
||
impl AsMetadata for u32 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clippy complained that the impl would be pulled up so better to define it outside. |
||
fn into_u32(self) -> u32 { | ||
self | ||
} | ||
|
||
fn from_u32(value: u32) -> Option<Self> { | ||
if value < 32 { | ||
Some(value) | ||
} else { | ||
None | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
struct ControllableRecord(u8); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,34 +165,37 @@ impl GlobalOptions { | |
pub fn merge(&self, with: Self) -> Result<Self, Vec<String>> { | ||
let mut errors = Vec::new(); | ||
|
||
if conflicts(&self.proxy.http, &with.proxy.http) { | ||
if conflicts(self.proxy.http.as_ref(), with.proxy.http.as_ref()) { | ||
errors.push("conflicting values for 'proxy.http' found".to_owned()); | ||
} | ||
|
||
if conflicts(&self.proxy.https, &with.proxy.https) { | ||
if conflicts(self.proxy.https.as_ref(), with.proxy.https.as_ref()) { | ||
errors.push("conflicting values for 'proxy.https' found".to_owned()); | ||
} | ||
|
||
if !self.proxy.no_proxy.is_empty() && !with.proxy.no_proxy.is_empty() { | ||
errors.push("conflicting values for 'proxy.no_proxy' found".to_owned()); | ||
} | ||
|
||
if conflicts(&self.timezone, &with.timezone) { | ||
if conflicts(self.timezone.as_ref(), with.timezone.as_ref()) { | ||
errors.push("conflicting values for 'timezone' found".to_owned()); | ||
} | ||
|
||
if conflicts( | ||
&self.acknowledgements.enabled, | ||
&with.acknowledgements.enabled, | ||
self.acknowledgements.enabled.as_ref(), | ||
with.acknowledgements.enabled.as_ref(), | ||
) { | ||
errors.push("conflicting values for 'acknowledgements' found".to_owned()); | ||
} | ||
|
||
if conflicts(&self.expire_metrics, &with.expire_metrics) { | ||
if conflicts(self.expire_metrics.as_ref(), with.expire_metrics.as_ref()) { | ||
errors.push("conflicting values for 'expire_metrics' found".to_owned()); | ||
} | ||
|
||
if conflicts(&self.expire_metrics_secs, &with.expire_metrics_secs) { | ||
if conflicts( | ||
self.expire_metrics_secs.as_ref(), | ||
with.expire_metrics_secs.as_ref(), | ||
) { | ||
errors.push("conflicting values for 'expire_metrics_secs' found".to_owned()); | ||
} | ||
|
||
|
@@ -239,7 +242,7 @@ impl GlobalOptions { | |
} | ||
} | ||
|
||
fn conflicts<T: PartialEq>(this: &Option<T>, that: &Option<T>) -> bool { | ||
fn conflicts<T: PartialEq>(this: Option<&T>, that: Option<&T>) -> bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✨ nice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. This is the clippy lint that required the most changes, but was mechanical: rather than a reference to an option use an option with a reference. |
||
matches!((this, that), (Some(this), Some(that)) if this != that) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should this be
///
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think so. We want this to be a doc comment so that is extracted and rendered in the docs.