Skip to content

Commit e23d404

Browse files
authored
Fix clippy. (#660)
2 parents f6ff5de + fd5f0f3 commit e23d404

File tree

8 files changed

+11
-26
lines changed

8 files changed

+11
-26
lines changed

gecko_profile/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl ProfileBuilder {
110110
marker_schemas
111111
}
112112

113-
pub fn to_serializable(&self) -> SerializableProfile {
113+
pub fn to_serializable(&self) -> SerializableProfile<'_> {
114114
SerializableProfile(self)
115115
}
116116
}

samply-api/src/symbolicate/request_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub enum Request {
88
}
99

1010
impl Request {
11-
pub fn jobs(&self) -> JobIterator {
11+
pub fn jobs(&self) -> JobIterator<'_> {
1212
match self {
1313
Request::WithJobsList { jobs } => JobIterator::WithJobsList(jobs.iter()),
1414
Request::JustOneJob(job) => JobIterator::JustOneJob(std::iter::once(job)),

samply-symbols/src/macho.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl<T: FileContents> MachOFatArchiveMemberData<T> {
492492
}
493493
}
494494

495-
pub fn data(&self) -> RangeReadRef<&'_ FileContentsWrapper<T>> {
495+
pub fn data(&self) -> RangeReadRef<'_, &'_ FileContentsWrapper<T>> {
496496
let file_contents_ref = &self.file_data;
497497
file_contents_ref.range(self.start_offset, self.range_size)
498498
}
@@ -629,7 +629,7 @@ impl<'data, R: ReadRef<'data>> MachOData<'data, R> {
629629

630630
fn load_command_iter<M: MachHeader>(
631631
&self,
632-
) -> object::read::Result<(M::Endian, LoadCommandIterator<M::Endian>)> {
632+
) -> object::read::Result<(M::Endian, LoadCommandIterator<'_, M::Endian>)> {
633633
let header = M::parse(self.data, self.header_offset)?;
634634
let endian = header.endian()?;
635635
let load_commands = header.load_commands(endian, self.data, self.header_offset)?;

samply-symbols/src/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<T: FileContents + 'static> PeSymbolMapDataAndObject<T> {
113113
}
114114

115115
impl<T: FileContents + 'static> ObjectSymbolMapOuter<T> for PeSymbolMapDataAndObject<T> {
116-
fn make_symbol_map_inner(&self) -> Result<ObjectSymbolMapInnerWrapper<T>, Error> {
116+
fn make_symbol_map_inner(&self) -> Result<ObjectSymbolMapInnerWrapper<'_, T>, Error> {
117117
let PeObject {
118118
file_data,
119119
object,
@@ -205,7 +205,7 @@ trait PdbAddr2lineContextTrait {
205205
fn find_frames(
206206
&self,
207207
probe: u32,
208-
) -> Result<Option<pdb_addr2line::FunctionFrames>, pdb_addr2line::Error>;
208+
) -> Result<Option<pdb_addr2line::FunctionFrames<'_>>, pdb_addr2line::Error>;
209209
fn function_count(&self) -> usize;
210210
fn functions(&self) -> Box<dyn Iterator<Item = pdb_addr2line::Function> + '_>;
211211
}
@@ -214,7 +214,7 @@ impl PdbAddr2lineContextTrait for pdb_addr2line::Context<'_, '_> {
214214
fn find_frames(
215215
&self,
216216
probe: u32,
217-
) -> Result<Option<pdb_addr2line::FunctionFrames>, pdb_addr2line::Error> {
217+
) -> Result<Option<pdb_addr2line::FunctionFrames<'_>>, pdb_addr2line::Error> {
218218
self.find_frames(probe)
219219
}
220220

samply/src/linux/perf_event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl Perf {
459459
}
460460

461461
#[inline]
462-
pub fn iter(&mut self) -> EventIter {
462+
pub fn iter(&mut self) -> EventIter<'_> {
463463
EventIter::new(self)
464464
}
465465
}

samply/src/mac/thread_info.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,6 @@ pub struct thread_extended_info {
5656
pub pth_name: [::std::os::raw::c_char; 64usize],
5757
}
5858
pub type thread_extended_info_data_t = thread_extended_info;
59-
#[repr(C)]
60-
#[derive(Debug, Default)]
61-
pub struct io_stat_entry {
62-
pub count: u64,
63-
pub size: u64,
64-
}
65-
#[repr(C)]
66-
#[derive(Debug, Default)]
67-
pub struct io_stat_info {
68-
pub disk_reads: io_stat_entry,
69-
pub io_priority: [io_stat_entry; 4usize],
70-
pub paging: io_stat_entry,
71-
pub metadata: io_stat_entry,
72-
pub total_io: io_stat_entry,
73-
}
7459

7560
pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
7661
(size_of::<thread_basic_info_data_t>() / size_of::<natural_t>()) as _;

samply/src/shared/process_sample_data.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ impl StaticSchemaMarker for OtherEventMarker {
219219
}
220220

221221
#[derive(Debug, Clone)]
222+
#[allow(dead_code)]
222223
pub struct UserTimingMarker(pub StringHandle);
223224

224225
impl StaticSchemaMarker for UserTimingMarker {

samply/src/windows/xperf.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ impl Xperf {
143143

144144
eprintln!("xperf session running...");
145145

146-
if user_etl_file.is_some() {
147-
self.state =
148-
XperfState::RecordingKernelAndUserToFile(kernel_etl_file, user_etl_file.unwrap());
146+
if let Some(user_etl) = user_etl_file {
147+
self.state = XperfState::RecordingKernelAndUserToFile(kernel_etl_file, user_etl);
149148
} else {
150149
self.state = XperfState::RecordingKernelToFile(kernel_etl_file);
151150
}

0 commit comments

Comments
 (0)