Skip to content

Commit

Permalink
Run cargo clippy --workspace --fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Dec 4, 2024
1 parent d525e7d commit 87ba94c
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub enum Subcategory {

pub struct SerializableSubcategoryColumn<'a>(pub &'a [Subcategory], pub &'a [Category]);

impl<'a> Serialize for SerializableSubcategoryColumn<'a> {
impl Serialize for SerializableSubcategoryColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.len()))?;
for subcategory in self.0 {
Expand Down
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct SerializableCounter<'a> {
main_thread_index: usize,
}

impl<'a> Serialize for SerializableCounter<'a> {
impl Serialize for SerializableCounter<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut map = serializer.serialize_map(None)?;
map.serialize_entry("category", &self.counter.category)?;
Expand Down
4 changes: 2 additions & 2 deletions fxprof-processed-profile/src/frame_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct SerializableFrameTable<'a> {
categories: &'a [Category],
}

impl<'a> Serialize for SerializableFrameTable<'a> {
impl Serialize for SerializableFrameTable<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let len = self.table.addresses.len();
let mut map = serializer.serialize_map(None)?;
Expand All @@ -140,7 +140,7 @@ impl<'a> Serialize for SerializableFrameTable<'a> {

struct SerializableFrameTableAddressColumn<'a>(&'a [Option<u32>]);

impl<'a> Serialize for SerializableFrameTableAddressColumn<'a> {
impl Serialize for SerializableFrameTableAddressColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.len()))?;
for address in self.0 {
Expand Down
4 changes: 2 additions & 2 deletions fxprof-processed-profile/src/func_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Serialize for FuncTable {

struct SerializableFuncTableResourceColumn<'a>(&'a [Option<ResourceIndex>]);

impl<'a> Serialize for SerializableFuncTableResourceColumn<'a> {
impl Serialize for SerializableFuncTableResourceColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.len()))?;
for resource in self.0 {
Expand All @@ -99,7 +99,7 @@ impl<'a> Serialize for SerializableFuncTableResourceColumn<'a> {

pub struct SerializableFlagColumn<'a>(&'a [FrameFlags], FrameFlags);

impl<'a> Serialize for SerializableFlagColumn<'a> {
impl Serialize for SerializableFlagColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.len()))?;
for item_flags in self.0 {
Expand Down
6 changes: 3 additions & 3 deletions fxprof-processed-profile/src/marker_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct SerializableMarkerTable<'a> {
schemas: &'a [InternalMarkerSchema],
}

impl<'a> Serialize for SerializableMarkerTable<'a> {
impl Serialize for SerializableMarkerTable<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let Self { marker_table, .. } = self;
let len = marker_table.marker_name_string_indexes.len();
Expand All @@ -147,7 +147,7 @@ impl<'a> Serialize for SerializableMarkerTable<'a> {

struct SerializableMarkerTableDataColumn<'a>(&'a SerializableMarkerTable<'a>);

impl<'a> Serialize for SerializableMarkerTableDataColumn<'a> {
impl Serialize for SerializableMarkerTableDataColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let marker_table = self.0.marker_table;
let schemas = self.0.schemas;
Expand Down Expand Up @@ -186,7 +186,7 @@ struct SerializableMarkerDataElement<'a> {
number_fields: &'a [f64],
}

impl<'a> Serialize for SerializableMarkerDataElement<'a> {
impl Serialize for SerializableMarkerDataElement<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let Self {
global_string_table,
Expand Down
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl Serialize for InternalMarkerSchema {

struct SerializableSchemaFields<'a>(&'a InternalMarkerSchema);

impl<'a> Serialize for SerializableSchemaFields<'a> {
impl Serialize for SerializableSchemaFields<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down
8 changes: 4 additions & 4 deletions fxprof-processed-profile/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ impl Serialize for Profile {

struct SerializableProfileMeta<'a>(&'a Profile);

impl<'a> Serialize for SerializableProfileMeta<'a> {
impl Serialize for SerializableProfileMeta<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut map = serializer.serialize_map(None)?;
map.serialize_entry("categories", &self.0.categories)?;
Expand Down Expand Up @@ -874,7 +874,7 @@ struct SerializableProfileThreadsProperty<'a> {
global_string_table: &'a GlobalStringTable,
}

impl<'a> Serialize for SerializableProfileThreadsProperty<'a> {
impl Serialize for SerializableProfileThreadsProperty<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.threads.len()))?;

Expand Down Expand Up @@ -902,7 +902,7 @@ struct SerializableProfileCountersProperty<'a> {
first_thread_index_per_process: &'a [usize],
}

impl<'a> Serialize for SerializableProfileCountersProperty<'a> {
impl Serialize for SerializableProfileCountersProperty<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.counters.len()))?;

Expand All @@ -923,7 +923,7 @@ struct SerializableProfileThread<'a>(
&'a GlobalStringTable,
);

impl<'a> Serialize for SerializableProfileThread<'a> {
impl Serialize for SerializableProfileThread<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let SerializableProfileThread(
process,
Expand Down
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/sample_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Serialize for SampleTable {

struct SliceWithPermutation<'a, T: Serialize>(&'a [T], &'a [usize]);

impl<'a, T: Serialize> Serialize for SliceWithPermutation<'a, T> {
impl<T: Serialize> Serialize for SliceWithPermutation<'_, T> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/serialization_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl<T: Serialize> Serialize for SerializableSingleValueColumn<T> {

pub struct SerializableOptionalTimestampColumn<'a>(pub &'a [Option<Timestamp>]);

impl<'a> Serialize for SerializableOptionalTimestampColumn<'a> {
impl Serialize for SerializableOptionalTimestampColumn<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.len()))?;
for timestamp in self.0 {
Expand Down
2 changes: 1 addition & 1 deletion fxprof-processed-profile/src/stack_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct SerializableStackTable<'a> {
categories: &'a [Category],
}

impl<'a> Serialize for SerializableStackTable<'a> {
impl Serialize for SerializableStackTable<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let len = self.table.stack_prefixes.len();
let mut map = serializer.serialize_map(Some(3))?;
Expand Down
20 changes: 10 additions & 10 deletions gecko_profile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub struct SerializableProfile<'a>(&'a ProfileBuilder);

use serde::ser::{Serialize, SerializeMap, SerializeSeq, Serializer};

impl<'a> Serialize for SerializableProfile<'a> {
impl Serialize for SerializableProfile<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let start_time_ms_since_unix_epoch = self
.0
Expand Down Expand Up @@ -360,7 +360,7 @@ pub struct SerializableProfileThread<'a, 'n> {
process_start: Instant,
}

impl<'a, 'n> Serialize for SerializableProfileThread<'a, 'n> {
impl Serialize for SerializableProfileThread<'_, '_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let name = if self.thread.is_main {
// https://github.com/firefox-devtools/profiler/issues/2508
Expand Down Expand Up @@ -486,7 +486,7 @@ impl Serialize for StackTable {

struct SerializableStackTableData<'a>(&'a StackTable);

impl<'a> Serialize for SerializableStackTableData<'a> {
impl Serialize for SerializableStackTableData<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.stacks.len()))?;
for stack in &self.0.stacks {
Expand All @@ -498,7 +498,7 @@ impl<'a> Serialize for SerializableStackTableData<'a> {

struct SerializableStackTableDataValue<'a>(&'a (Option<usize>, usize));

impl<'a> Serialize for SerializableStackTableDataValue<'a> {
impl Serialize for SerializableStackTableDataValue<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let (prefix, frame_index) = self.0;
let mut seq = serializer.serialize_seq(Some(2))?;
Expand Down Expand Up @@ -564,7 +564,7 @@ impl Serialize for FrameTable {

struct SerializableFrameTableData<'a>(&'a FrameTable);

impl<'a> Serialize for SerializableFrameTableData<'a> {
impl Serialize for SerializableFrameTableData<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.0.frames.len()))?;
for location in &self.0.frames {
Expand Down Expand Up @@ -609,7 +609,7 @@ struct SerializableSampleTable<'a> {
process_start: Instant,
}

impl<'a> Serialize for SerializableSampleTable<'a> {
impl Serialize for SerializableSampleTable<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let schema = json!({
"stack": 0,
Expand All @@ -634,7 +634,7 @@ struct SerializableSampleTableData<'a> {
process_start: Instant,
}

impl<'a> Serialize for SerializableSampleTableData<'a> {
impl Serialize for SerializableSampleTableData<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.table.0.len()))?;
for sample in &self.table.0 {
Expand Down Expand Up @@ -693,7 +693,7 @@ struct SerializableMarkerTable<'a> {
process_start: Instant,
}

impl<'a> Serialize for SerializableMarkerTable<'a> {
impl Serialize for SerializableMarkerTable<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let schema = json!({
"name": 0,
Expand All @@ -720,7 +720,7 @@ struct SerializableMarkerTableData<'a> {
process_start: Instant,
}

impl<'a> Serialize for SerializableMarkerTableData<'a> {
impl Serialize for SerializableMarkerTableData<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(self.table.0.len()))?;
for marker in &self.table.0 {
Expand All @@ -738,7 +738,7 @@ struct SerializableMarkerTableDataValue<'a> {
data: &'a Value,
}

impl<'a> Serialize for SerializableMarkerTableDataValue<'a> {
impl Serialize for SerializableMarkerTableDataValue<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut seq = serializer.serialize_seq(Some(6))?;
seq.serialize_element(&self.name_string_index.0)?; // name
Expand Down
2 changes: 1 addition & 1 deletion samply-symbols/src/breakpad/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ pub struct BreakpadFuncSymbolInfo<'a> {
pub inlinees: Vec<Inlinee>,
}

impl<'a> BreakpadFuncSymbolInfo<'a> {
impl BreakpadFuncSymbolInfo<'_> {
/// Returns `(file_id, line, address)` of the line record that covers the
/// given address. Line records describe locations at the deepest level of
/// inlining at that address.
Expand Down
2 changes: 1 addition & 1 deletion samply-symbols/src/breakpad/symbol_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<'a, I: FileOrInlineOrigin, T: FileContents> ItemCache<'a, I, T> {
}
}

impl<'a, T: FileContents> SymbolMapTrait for BreakpadSymbolMapInner<'a, T> {
impl<T: FileContents> SymbolMapTrait for BreakpadSymbolMapInner<'_, T> {
fn debug_id(&self) -> debugid::DebugId {
self.index.debug_id
}
Expand Down
2 changes: 1 addition & 1 deletion samply-symbols/src/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ where
)
.ok()?;

return Some(SingleSectionData::Owned(decompressed));
Some(SingleSectionData::Owned(decompressed))
}
_ => None,
}
Expand Down
4 changes: 2 additions & 2 deletions samply-symbols/src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl<'data, T: FileContents + 'static> ElfObjects<'data, T> {
}
}

impl<'data, T: FileContents + 'static> DwoDwarfMaker<T> for ElfObjects<'data, T> {
impl<T: FileContents + 'static> DwoDwarfMaker<T> for ElfObjects<'_, T> {
fn add_dwo_and_make_dwarf(
&self,
dwo_file_data: T,
Expand All @@ -398,7 +398,7 @@ impl<'data, T: FileContents + 'static> DwoDwarfMaker<T> for ElfObjects<'data, T>
}
}

impl<'data, T: FileContents + 'static> ElfObjectsTrait<T> for ElfObjects<'data, T> {
impl<T: FileContents + 'static> ElfObjectsTrait<T> for ElfObjects<'_, T> {
fn make_inner(&self) -> Result<ObjectSymbolMapInnerWrapper<'_, T>, Error> {
let debug_id = if let Some(debug_id) = self.override_debug_id {
debug_id
Expand Down
4 changes: 2 additions & 2 deletions samply-symbols/src/external_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct ExternalFileInner<'a, T: FileContents> {
path_mapper: Mutex<PathMapper<()>>,
}

impl<'a, F: FileContents> ExternalFileInnerTrait for ExternalFileInner<'a, F> {
impl<F: FileContents> ExternalFileInnerTrait for ExternalFileInner<'_, F> {
fn lookup(
&self,
external_file_address: &ExternalFileAddressInFileRef,
Expand Down Expand Up @@ -210,7 +210,7 @@ struct ExternalFileMemberContext<'a> {
symbol_addresses: HashMap<&'a [u8], u64>,
}

impl<'a> ExternalFileMemberContext<'a> {
impl ExternalFileMemberContext<'_> {
pub fn lookup(
&self,
symbol_name: &[u8],
Expand Down
4 changes: 2 additions & 2 deletions samply-symbols/src/jitdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl<'a, T: FileContents> JitDumpSymbolMapCache<'a, T> {
}
}

impl<'a, T: FileContents> JitDumpSymbolMapInner<'a, T> {
impl<T: FileContents> JitDumpSymbolMapInner<'_, T> {
fn lookup_by_entry_index(
&self,
index: usize,
Expand Down Expand Up @@ -300,7 +300,7 @@ impl<'a, T: FileContents> JitDumpSymbolMapInner<'a, T> {
}
}

impl<'a, T: FileContents> SymbolMapTrait for JitDumpSymbolMapInner<'a, T> {
impl<T: FileContents> SymbolMapTrait for JitDumpSymbolMapInner<'_, T> {
fn debug_id(&self) -> debugid::DebugId {
self.index.debug_id
}
Expand Down
4 changes: 2 additions & 2 deletions samply-symbols/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ impl<'a, T: FileContents> FileContentsCursor<'a, T> {
}
}

impl<'a, T: FileContents> std::io::Read for FileContentsCursor<'a, T> {
impl<T: FileContents> std::io::Read for FileContentsCursor<'_, T> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
let read_len = <[u8]>::len(buf).min(self.remaining_len as usize);
// Make a silly copy
Expand All @@ -1127,7 +1127,7 @@ impl<'a, T: FileContents> std::io::Read for FileContentsCursor<'a, T> {
}
}

impl<'a, T: FileContents> std::io::Seek for FileContentsCursor<'a, T> {
impl<T: FileContents> std::io::Seek for FileContentsCursor<'_, T> {
fn seek(&mut self, pos: std::io::SeekFrom) -> std::io::Result<u64> {
/// Returns (new_offset, new_remaining_len)
fn inner(cur: u64, total_len: u64, pos: std::io::SeekFrom) -> Option<(u64, u64)> {
Expand Down
10 changes: 5 additions & 5 deletions samply-symbols/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ trait PdbObjectTrait {
#[derive(Yokeable)]
pub struct PdbObjectWrapper<'data>(Box<dyn PdbObjectTrait + Send + 'data>);

impl<'data, FC: FileContents + 'static> PdbObjectTrait for PdbObject<'data, FC> {
impl<FC: FileContents + 'static> PdbObjectTrait for PdbObject<'_, FC> {
fn make_pdb_symbol_map(&self) -> Result<PdbSymbolMapInner<'_>, Error> {
let context = self.make_context()?;

Expand All @@ -195,7 +195,7 @@ impl<'data, FC: FileContents + 'static> PdbObjectTrait for PdbObject<'data, FC>
}
}

impl<'data, FC: FileContents + 'static> PdbObject<'data, FC> {
impl<FC: FileContents + 'static> PdbObject<'_, FC> {
fn make_context<'object>(
&'object self,
) -> Result<Box<dyn PdbAddr2lineContextTrait + Send + 'object>, Error> {
Expand All @@ -213,7 +213,7 @@ trait PdbAddr2lineContextTrait {
fn functions(&self) -> Box<dyn Iterator<Item = pdb_addr2line::Function> + '_>;
}

impl<'a, 's> PdbAddr2lineContextTrait for pdb_addr2line::Context<'a, 's> {
impl PdbAddr2lineContextTrait for pdb_addr2line::Context<'_, '_> {
fn find_frames(
&self,
probe: u32,
Expand All @@ -239,7 +239,7 @@ struct PdbSymbolMapInner<'object> {
path_mapper: Mutex<PathMapper<SrcSrvPathMapper<'object>>>,
}

impl<'object> SymbolMapTrait for PdbSymbolMapInner<'object> {
impl SymbolMapTrait for PdbSymbolMapInner<'_> {
fn debug_id(&self) -> DebugId {
self.debug_id
}
Expand Down Expand Up @@ -436,7 +436,7 @@ struct SrcSrvPathMapper<'a> {
command_is_file_download_with_url_in_var4_and_uncompress_function_in_var5: bool,
}

impl<'a> ExtraPathMapper for SrcSrvPathMapper<'a> {
impl ExtraPathMapper for SrcSrvPathMapper<'_> {
fn map_path(&mut self, path: &str) -> Option<MappedPath> {
if let Some(value) = self.cache.get(path) {
return value.clone();
Expand Down
2 changes: 1 addition & 1 deletion samply/src/linux/perf_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ impl<'a> EventIter<'a> {
}
}

impl<'a> Iterator for EventIter<'a> {
impl Iterator for EventIter<'_> {
type Item = EventRef;

#[inline]
Expand Down
Loading

0 comments on commit 87ba94c

Please sign in to comment.