From 58f06def0a9322c28145d2cc4d42e4f894577a8e Mon Sep 17 00:00:00 2001 From: Kyle Sabo Date: Sun, 23 Nov 2025 18:17:26 -0800 Subject: [PATCH] 1.91 clippy --- eventheader/Cargo.toml | 2 +- eventheader_dynamic/Cargo.toml | 2 +- eventheader_dynamic/src/provider.rs | 2 +- eventheader_macros/Cargo.toml | 2 +- eventheader_macros/src/parser.rs | 2 +- eventheader_macros/src/tree.rs | 2 +- eventheader_types/Cargo.toml | 2 +- tracepoint/Cargo.toml | 2 +- tracepoint_decode/Cargo.toml | 2 +- tracepoint_decode/src/perf_event_data.rs | 8 ++++---- tracepoint_decode/src/perf_item.rs | 4 ++-- tracepoint_decode/src/writers.rs | 2 +- tracepoint_perf/Cargo.toml | 2 +- tracepoint_perf/src/file_reader.rs | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eventheader/Cargo.toml b/eventheader/Cargo.toml index 9f0e604..31c3823 100644 --- a/eventheader/Cargo.toml +++ b/eventheader/Cargo.toml @@ -21,7 +21,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [features] default = ["user_events", "macros"] diff --git a/eventheader_dynamic/Cargo.toml b/eventheader_dynamic/Cargo.toml index 10494b8..e16e061 100644 --- a/eventheader_dynamic/Cargo.toml +++ b/eventheader_dynamic/Cargo.toml @@ -21,7 +21,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [features] default = ["user_events"] diff --git a/eventheader_dynamic/src/provider.rs b/eventheader_dynamic/src/provider.rs index b9bfcd5..7f9fd23 100644 --- a/eventheader_dynamic/src/provider.rs +++ b/eventheader_dynamic/src/provider.rs @@ -402,7 +402,7 @@ impl Ord for EventSet { impl PartialOrd for EventSet { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.key.cmp(&other.key)) + Some(self.cmp(other)) } } diff --git a/eventheader_macros/Cargo.toml b/eventheader_macros/Cargo.toml index 58f5883..f82af14 100644 --- a/eventheader_macros/Cargo.toml +++ b/eventheader_macros/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" description = "Rust macros for eventheader-encoded Linux Tracepoints via user_events" repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [lib] proc-macro = true diff --git a/eventheader_macros/src/parser.rs b/eventheader_macros/src/parser.rs index c306cfe..4e6030b 100644 --- a/eventheader_macros/src/parser.rs +++ b/eventheader_macros/src/parser.rs @@ -207,7 +207,7 @@ impl<'a> Parser<'a> { /// Reads OptionIdent(ArgsGroup) or {...} then moves to the next comma or the end-of-stream. /// Emits "expected option" errors for non-option syntax. /// Emits "expected ..." error for other tokens encountered before comma or end-of-stream. - pub fn next_arg(&mut self, want_struct: bool) -> ArgResult { + pub fn next_arg(&mut self, want_struct: bool) -> ArgResult<'_> { const EXPECTED_OPTION: &str = "expected identifier for option name, e.g. Option(args...)"; const EXPECTED_OPTION_OR_STRUCT: &str = "expected '{' for struct or identifier for option name, e.g. Option(args...)"; diff --git a/eventheader_macros/src/tree.rs b/eventheader_macros/src/tree.rs index 6bc1ecd..5f153d1 100644 --- a/eventheader_macros/src/tree.rs +++ b/eventheader_macros/src/tree.rs @@ -32,7 +32,7 @@ impl Tree { return self; } - pub fn drain(&mut self) -> vec::Drain { + pub fn drain(&mut self) -> vec::Drain<'_, TokenTree> { debug_assert!(self.span_stack.is_empty()); return self.trees.drain(..); } diff --git a/eventheader_types/Cargo.toml b/eventheader_types/Cargo.toml index 31d3322..5786e4e 100644 --- a/eventheader_types/Cargo.toml +++ b/eventheader_types/Cargo.toml @@ -21,7 +21,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [dependencies] diff --git a/tracepoint/Cargo.toml b/tracepoint/Cargo.toml index 1ae7374..542d872 100644 --- a/tracepoint/Cargo.toml +++ b/tracepoint/Cargo.toml @@ -20,7 +20,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [features] default = ["user_events"] diff --git a/tracepoint_decode/Cargo.toml b/tracepoint_decode/Cargo.toml index cce69eb..c02e0b0 100644 --- a/tracepoint_decode/Cargo.toml +++ b/tracepoint_decode/Cargo.toml @@ -20,7 +20,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.74" [features] default = ["rustc_1_77"] diff --git a/tracepoint_decode/src/perf_event_data.rs b/tracepoint_decode/src/perf_event_data.rs index e596254..3416920 100644 --- a/tracepoint_decode/src/perf_event_data.rs +++ b/tracepoint_decode/src/perf_event_data.rs @@ -199,7 +199,7 @@ impl<'a> PerfNonSampleEventInfo<'a> { /// value as the [PerfNonSampleEventInfo::name] method, but as a Display object (can /// be passed to a format macro) and with JSON escaping applied (control chars, /// quotes, and backslashes are escaped) - pub fn json_name_display(&self) -> display::JsonEscapeDisplay { + pub fn json_name_display(&self) -> display::JsonEscapeDisplay<'_> { display::JsonEscapeDisplay::new(self.name()) } @@ -230,7 +230,7 @@ impl<'a> PerfNonSampleEventInfo<'a> { /// - `"tid": 124` (omitted if unavailable or if pid is shown and pid == tid) /// - `"provider": "SystemName"` (omitted if unavailable) /// - `"event": "TracepointName"` (omitted if unavailable) - pub const fn json_meta_display(&self) -> display::EventInfoJsonMetaDisplay { + pub const fn json_meta_display(&self) -> display::EventInfoJsonMetaDisplay<'_> { display::EventInfoJsonMetaDisplay::new( self.session_info, self.event_desc, @@ -398,7 +398,7 @@ impl<'a> PerfSampleEventInfo<'a> { /// value as the [PerfSampleEventInfo::name] method, but as a Display object (can /// be passed to a format macro) and with JSON escaping applied (control chars, /// quotes, and backslashes are escaped) - pub fn json_name_display(&self) -> display::JsonEscapeDisplay { + pub fn json_name_display(&self) -> display::JsonEscapeDisplay<'_> { display::JsonEscapeDisplay::new(self.name()) } @@ -471,7 +471,7 @@ impl<'a> PerfSampleEventInfo<'a> { /// - `"tid": 124` (omitted if unavailable or if pid is shown and pid == tid) /// - `"provider": "SystemName"` (omitted if unavailable) /// - `"event": "TracepointName"` (omitted if unavailable) - pub const fn json_meta_display(&self) -> display::EventInfoJsonMetaDisplay { + pub const fn json_meta_display(&self) -> display::EventInfoJsonMetaDisplay<'_> { display::EventInfoJsonMetaDisplay::new( self.session_info, self.event_desc, diff --git a/tracepoint_decode/src/perf_item.rs b/tracepoint_decode/src/perf_item.rs index a0c584e..4d7e401 100644 --- a/tracepoint_decode/src/perf_item.rs +++ b/tracepoint_decode/src/perf_item.rs @@ -901,7 +901,7 @@ impl<'dat> PerfItemValue<'dat> { /// /// For example, `write!(writer, "{}", value.display())` might generate a string /// like `53`, `true`, `Hello`, or `1, 2, 3`. - pub fn display(&self) -> display::PerfItemValueDisplay { + pub fn display(&self) -> display::PerfItemValueDisplay<'_> { return display::PerfItemValueDisplay::new(self); } @@ -1192,7 +1192,7 @@ impl<'dat> PerfItemValue<'dat> { /// /// For example, `write!(str, "{}", value.json_display())` might generate a string /// like `53`, `true`, `"Hello"`, or `[1, 2, 3]`. - pub fn json_display(&self) -> display::PerfItemValueJsonDisplay { + pub fn json_display(&self) -> display::PerfItemValueJsonDisplay<'_> { return display::PerfItemValueJsonDisplay::new(self); } diff --git a/tracepoint_decode/src/writers.rs b/tracepoint_decode/src/writers.rs index 8f2d130..ef01e9d 100644 --- a/tracepoint_decode/src/writers.rs +++ b/tracepoint_decode/src/writers.rs @@ -104,7 +104,7 @@ pub mod date_time { tm: unsafe { core::mem::zeroed() }, }; - if unsafe { core::ptr::null() == libc::gmtime_r(&value, &mut this.tm) } { + if unsafe { libc::gmtime_r(&value, &mut this.tm).is_null() } { this.tm.tm_mday = 0; } diff --git a/tracepoint_perf/Cargo.toml b/tracepoint_perf/Cargo.toml index 8dfead8..0c00bf0 100644 --- a/tracepoint_perf/Cargo.toml +++ b/tracepoint_perf/Cargo.toml @@ -19,7 +19,7 @@ categories = [ ] repository = "https://github.com/microsoft/LinuxTracepoints-Rust" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [dependencies] eventheader_types = { version = "= 0.4.1", path = "../eventheader_types" } diff --git a/tracepoint_perf/src/file_reader.rs b/tracepoint_perf/src/file_reader.rs index 1cc750a..357e511 100644 --- a/tracepoint_perf/src/file_reader.rs +++ b/tracepoint_perf/src/file_reader.rs @@ -243,7 +243,7 @@ impl PerfDataFileReader { /// Returns the header and data of the current event. /// If there is no current event, returns a default-constructed `PerfEventBytes`. - pub fn current_event(&self) -> PerfEventBytes { + pub fn current_event(&self) -> PerfEventBytes<'_> { if self.current.range.len() < PERF_EVENT_HEADER_SIZE { return PerfEventBytes::new(PerfEventHeader::default(), &[]); } else {