Skip to content

Commit

Permalink
chore: Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim committed Nov 29, 2024
1 parent e6246b1 commit 49893a0
Show file tree
Hide file tree
Showing 28 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion examples/minidump_stackwalk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl<'a> LocalSymbolProvider<'a> {
}

#[async_trait]
impl<'a> minidump_unwind::SymbolProvider for LocalSymbolProvider<'a> {
impl minidump_unwind::SymbolProvider for LocalSymbolProvider<'_> {
#[tracing::instrument(
skip(self, module, frame),
fields(module.id, frame.instruction = frame.get_instruction())
Expand Down
2 changes: 1 addition & 1 deletion symbolic-cabi/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl From<String> for SymbolicStr {
}
}

impl<'a> From<&'a str> for SymbolicStr {
impl From<&str> for SymbolicStr {
fn from(string: &str) -> SymbolicStr {
SymbolicStr::new(string)
}
Expand Down
2 changes: 1 addition & 1 deletion symbolic-cabi/src/proguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct Inner<'a> {
impl<'slf, 'a: 'slf> AsSelf<'slf> for Inner<'a> {
type Ref = Inner<'slf>;

fn as_self(&'slf self) -> &Self::Ref {
fn as_self(&'slf self) -> &'slf Self::Ref {
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion symbolic-cfi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ struct CfiCacheV1<'a> {
byteview: ByteView<'a>,
}

impl<'a> CfiCacheV1<'a> {
impl CfiCacheV1<'_> {
pub fn raw(&self) -> &[u8] {
&self.byteview
}
Expand Down
4 changes: 2 additions & 2 deletions symbolic-debuginfo/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub struct Symbol<'data> {
pub size: u64,
}

impl<'data> Symbol<'data> {
impl Symbol<'_> {
/// Returns the name of this symbol as string.
pub fn name(&self) -> Option<&str> {
self.name.as_ref().map(Cow::as_ref)
Expand All @@ -251,7 +251,7 @@ impl<'data> Symbol<'data> {
}
}

impl<'d> fmt::Debug for Symbol<'d> {
impl fmt::Debug for Symbol<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Symbol")
.field("name", &self.name().unwrap_or("<unknown>"))
Expand Down
10 changes: 5 additions & 5 deletions symbolic-debuginfo/src/breakpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ pub struct BreakpadLineRecords<'d> {
finished: bool,
}

impl<'d> Iterator for BreakpadLineRecords<'d> {
impl Iterator for BreakpadLineRecords<'_> {
type Item = Result<BreakpadLineRecord, BreakpadError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -752,13 +752,13 @@ impl<'d> BreakpadStackCfiRecord<'d> {
}
}

impl<'d> PartialEq for BreakpadStackCfiRecord<'d> {
impl PartialEq for BreakpadStackCfiRecord<'_> {
fn eq(&self, other: &Self) -> bool {
self.start == other.start && self.size == other.size && self.init_rules == other.init_rules
}
}

impl<'d> Eq for BreakpadStackCfiRecord<'d> {}
impl Eq for BreakpadStackCfiRecord<'_> {}

/// An iterator over stack cfi delta records associated with a particular
/// [`BreakpadStackCfiRecord`].
Expand Down Expand Up @@ -1263,7 +1263,7 @@ pub struct BreakpadDebugSession<'data> {
lines: Lines<'data>,
}

impl<'data> BreakpadDebugSession<'data> {
impl BreakpadDebugSession<'_> {
/// Returns an iterator over all functions in this debug file.
pub fn functions(&self) -> BreakpadFunctionIterator<'_> {
BreakpadFunctionIterator::new(&self.file_map, self.lines.clone())
Expand All @@ -1285,7 +1285,7 @@ impl<'data> BreakpadDebugSession<'data> {
}
}

impl<'data, 'session> DebugSession<'session> for BreakpadDebugSession<'data> {
impl<'session> DebugSession<'session> for BreakpadDebugSession<'_> {
type Error = BreakpadError;
type FunctionIterator = BreakpadFunctionIterator<'session>;
type FileIterator = BreakpadFileIterator<'session>;
Expand Down
6 changes: 3 additions & 3 deletions symbolic-debuginfo/src/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ struct UnitRef<'d, 'a> {
unit: &'a Unit<'d>,
}

impl<'d, 'a> UnitRef<'d, 'a> {
impl<'d> UnitRef<'d, '_> {
/// Resolve the binary value of an attribute.
#[inline(always)]
fn slice_value(&self, value: AttributeValue<Slice<'d>>) -> Option<&'d [u8]> {
Expand Down Expand Up @@ -996,7 +996,7 @@ struct FunctionsOutput<'a, 'd> {
pub seen_ranges: &'a mut BTreeSet<(u64, u64)>,
}

impl<'a, 'd> FunctionsOutput<'a, 'd> {
impl<'a> FunctionsOutput<'a, '_> {
pub fn with_seen_ranges(seen_ranges: &'a mut BTreeSet<(u64, u64)>) -> Self {
Self {
functions: Vec::new(),
Expand Down Expand Up @@ -1356,7 +1356,7 @@ impl<'data> DwarfDebugSession<'data> {
}
}

impl<'data, 'session> DebugSession<'session> for DwarfDebugSession<'data> {
impl<'session> DebugSession<'session> for DwarfDebugSession<'_> {
type Error = DwarfError;
type FunctionIterator = DwarfFunctionIterator<'session>;
type FileIterator = DwarfFileIterator<'session>;
Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ pub struct ElfSymbolIterator<'data, 'object> {
load_addr: u64,
}

impl<'data, 'object> Iterator for ElfSymbolIterator<'data, 'object> {
impl<'data> Iterator for ElfSymbolIterator<'data, '_> {
type Item = Symbol<'data>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions symbolic-debuginfo/src/function_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ struct FunctionBuilderInlinee<'s> {
}

/// Implement ordering in DFS order, i.e. first by address and then by depth.
impl<'s> PartialOrd for FunctionBuilderInlinee<'s> {
impl PartialOrd for FunctionBuilderInlinee<'_> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

/// Implement ordering in DFS order, i.e. first by address and then by depth.
impl<'s> Ord for FunctionBuilderInlinee<'s> {
impl Ord for FunctionBuilderInlinee<'_> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
(self.address, self.depth).cmp(&(other.address, other.depth))
}
Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/macho/bcsymbolmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub struct BcSymbolMapIterator<'a, 'd> {
iter: std::slice::Iter<'a, &'d str>,
}

impl<'a, 'd> Iterator for BcSymbolMapIterator<'a, 'd> {
impl<'d> Iterator for BcSymbolMapIterator<'_, 'd> {
type Item = &'d str;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
5 changes: 2 additions & 3 deletions symbolic-debuginfo/src/macho/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2103,10 +2103,9 @@ mod test {
const COMPRESSED_PAGE_KIND: u32 = 3;

fn align(offset: u32, align: u32) -> u32 {
// Adding `align - 1` to a value push unaligned values to the next multiple,
// and integer division + multiplication can then remove the remainder.
((offset + align - 1) / align) * align
offset.div_ceil(align) * align
}

fn pack_x86_rbp_registers(regs: [u8; 5]) -> u32 {
let mut result: u32 = 0;
let base_offset = 0;
Expand Down
4 changes: 2 additions & 2 deletions symbolic-debuginfo/src/macho/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ pub struct FatMachObjectIterator<'d, 'a> {
data: &'d [u8],
}

impl<'d, 'a> Iterator for FatMachObjectIterator<'d, 'a> {
impl<'d> Iterator for FatMachObjectIterator<'d, '_> {
type Item = Result<MachObject<'d>, MachError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -661,7 +661,7 @@ enum MachObjectIteratorInner<'d, 'a> {
/// An iterator over objects in a [`MachArchive`](struct.MachArchive.html).
pub struct MachObjectIterator<'d, 'a>(MachObjectIteratorInner<'d, 'a>);

impl<'d, 'a> Iterator for MachObjectIterator<'d, 'a> {
impl<'d> Iterator for MachObjectIterator<'d, '_> {
type Item = Result<MachObject<'d>, MachError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
6 changes: 3 additions & 3 deletions symbolic-debuginfo/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub enum ObjectDebugSession<'d> {
PortablePdb(PortablePdbDebugSession<'d>),
}

impl<'d> ObjectDebugSession<'d> {
impl ObjectDebugSession<'_> {
/// Returns an iterator over all functions in this debug file.
///
/// Functions are iterated in the order they are declared in their compilation units. The
Expand Down Expand Up @@ -606,7 +606,7 @@ pub enum SymbolIterator<'data, 'object> {
PortablePdb(PortablePdbSymbolIterator<'data>),
}

impl<'data, 'object> Iterator for SymbolIterator<'data, 'object> {
impl<'data> Iterator for SymbolIterator<'data, '_> {
type Item = Symbol<'data>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -778,7 +778,7 @@ enum ObjectIteratorInner<'d, 'a> {
/// An iterator over [`Object`](enum.Object.html)s in an [`Archive`](struct.Archive.html).
pub struct ObjectIterator<'d, 'a>(ObjectIteratorInner<'d, 'a>);

impl<'d, 'a> Iterator for ObjectIterator<'d, 'a> {
impl<'d> Iterator for ObjectIterator<'d, '_> {
type Item = Result<Object<'d>, ObjectError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/pdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ pub struct PdbSymbolIterator<'data, 'object> {
executable_sections: &'object ExecutableSections,
}

impl<'data, 'object> Iterator for PdbSymbolIterator<'data, 'object> {
impl<'data> Iterator for PdbSymbolIterator<'data, '_> {
type Item = Symbol<'data>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
6 changes: 3 additions & 3 deletions symbolic-debuginfo/src/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ pub struct PeSymbolIterator<'data, 'object> {
exports: std::slice::Iter<'object, pe::export::Export<'data>>,
}

impl<'data, 'object> Iterator for PeSymbolIterator<'data, 'object> {
impl<'data> Iterator for PeSymbolIterator<'data, '_> {
type Item = Symbol<'data>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -506,9 +506,9 @@ pub struct PeEmbeddedPortablePDB<'data> {
uncompressed_size: usize,
}

impl<'data, 'object> PeEmbeddedPortablePDB<'data> {
impl PeEmbeddedPortablePDB<'_> {
/// Returns the uncompressed size of the Portable PDB buffer.
pub fn get_size(&'object self) -> usize {
pub fn get_size(&self) -> usize {
self.uncompressed_size
}

Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/ppdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'data> PortablePdbDebugSession<'data> {
}
}

impl<'data, 'session> DebugSession<'session> for PortablePdbDebugSession<'data> {
impl<'session> DebugSession<'session> for PortablePdbDebugSession<'_> {
type Error = FormatError;
type FunctionIterator = PortablePdbFunctionIterator<'session>;
type FileIterator = PortablePdbFileIterator<'session>;
Expand Down
4 changes: 2 additions & 2 deletions symbolic-debuginfo/src/sourcebundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ pub struct SourceBundleDebugSession<'data> {
source_links: SourceLinkMappings,
}

impl<'data> SourceBundleDebugSession<'data> {
impl SourceBundleDebugSession<'_> {
/// Returns an iterator over all source files in this debug file.
pub fn files(&self) -> SourceBundleFileIterator<'_> {
SourceBundleFileIterator {
Expand Down Expand Up @@ -970,7 +970,7 @@ impl<'data> SourceBundleDebugSession<'data> {
}
}

impl<'data, 'session> DebugSession<'session> for SourceBundleDebugSession<'data> {
impl<'session> DebugSession<'session> for SourceBundleDebugSession<'_> {
type Error = SourceBundleError;
type FunctionIterator = SourceBundleFunctionIterator<'session>;
type FileIterator = SourceBundleFileIterator<'session>;
Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub struct WasmSymbolIterator<'data, 'object> {
_marker: std::marker::PhantomData<&'object u8>,
}

impl<'data, 'object> Iterator for WasmSymbolIterator<'data, 'object> {
impl<'data> Iterator for WasmSymbolIterator<'data, '_> {
type Item = Symbol<'data>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/wasm/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl BitVec {

pub fn resize(&mut self, count: usize, value: bool) {
self.data.resize(
(count + u64::BITS as usize - 1) / u64::BITS as usize,
count.div_ceil(u64::BITS as usize),
if value { u64::MAX } else { u64::MIN },
);
self.len = count;
Expand Down
2 changes: 1 addition & 1 deletion symbolic-demangle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pub trait Demangle {
fn try_demangle(&self, opts: DemangleOptions) -> Cow<'_, str>;
}

impl<'a> Demangle for Name<'a> {
impl Demangle for Name<'_> {
fn detect_language(&self) -> Language {
if self.language() != Language::Unknown {
return self.language();
Expand Down
2 changes: 1 addition & 1 deletion symbolic-ppdb/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<'data> PortablePdbCache<'data> {
}
}

impl<'data> std::fmt::Debug for PortablePdbCache<'data> {
impl std::fmt::Debug for PortablePdbCache<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("PortablePdbCache")
.field("version", &self.header.version)
Expand Down
8 changes: 4 additions & 4 deletions symbolic-ppdb/src/format/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub struct Table<'data> {
contents: &'data [u8],
}

impl<'data> fmt::Debug for Table<'data> {
impl fmt::Debug for Table<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let cols: Vec<usize> = self
.columns
Expand Down Expand Up @@ -231,7 +231,7 @@ pub(crate) struct Row<'data> {
table: &'data Table<'data>,
}

impl<'data> Row<'data> {
impl Row<'_> {
/// Reads the `col` cell in the given table as a `u32`.
///
/// This returns an error if the indices are out of bounds for the table
Expand Down Expand Up @@ -861,7 +861,7 @@ impl<'data> Index<TableType> for MetadataStream<'data> {
}
}

impl<'data> IndexMut<TableType> for MetadataStream<'data> {
impl IndexMut<TableType> for MetadataStream<'_> {
fn index_mut(&mut self, index: TableType) -> &mut Self::Output {
&mut self.tables[index as usize]
}
Expand Down Expand Up @@ -910,7 +910,7 @@ macro_rules! ok_or_return {
};
}

impl<'data> Iterator for CustomDebugInformationIterator<'data> {
impl Iterator for CustomDebugInformationIterator<'_> {
type Item = Result<CustomDebugInformation, FormatError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion symbolic-ppdb/src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ impl<'object, 'data> EmbeddedSourceIterator<'object, 'data> {
}
}

impl<'object, 'data> Iterator for EmbeddedSourceIterator<'object, 'data> {
impl<'data> Iterator for EmbeddedSourceIterator<'_, 'data> {
type Item = Result<EmbeddedSource<'data>, FormatError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion symbolic-ppdb/src/format/sequence_points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ pub(crate) struct SequencePoints<'data, 'ppdb> {
count: usize,
}

impl<'data, 'ppdb> Iterator for SequencePoints<'data, 'ppdb> {
impl Iterator for SequencePoints<'_, '_> {
type Item = Result<Vec<SequencePoint>, FormatError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion symbolic-sourcemapcache/src/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'slf, 'a: 'slf> AsSelf<'slf> for SourceMapCache<'a> {
}
}

impl<'data> std::fmt::Debug for SourceMapCache<'data> {
impl std::fmt::Debug for SourceMapCache<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SourceMapCache")
.field("version", &self.header.version)
Expand Down
2 changes: 1 addition & 1 deletion symbolic-symcache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub struct SymCache<'data> {
string_bytes: &'data [u8],
}

impl<'data> std::fmt::Debug for SymCache<'data> {
impl std::fmt::Debug for SymCache<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SymCache")
.field("version", &self.header.version)
Expand Down
Loading

0 comments on commit 49893a0

Please sign in to comment.