diff --git a/examples/minidump_stackwalk/src/main.rs b/examples/minidump_stackwalk/src/main.rs index fd6a5302..b7bf9c66 100644 --- a/examples/minidump_stackwalk/src/main.rs +++ b/examples/minidump_stackwalk/src/main.rs @@ -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()) diff --git a/symbolic-cabi/src/core.rs b/symbolic-cabi/src/core.rs index 6e0d8e92..77e8b25a 100644 --- a/symbolic-cabi/src/core.rs +++ b/symbolic-cabi/src/core.rs @@ -87,7 +87,7 @@ impl From for SymbolicStr { } } -impl<'a> From<&'a str> for SymbolicStr { +impl From<&str> for SymbolicStr { fn from(string: &str) -> SymbolicStr { SymbolicStr::new(string) } diff --git a/symbolic-cabi/src/proguard.rs b/symbolic-cabi/src/proguard.rs index 02798312..92c91cae 100644 --- a/symbolic-cabi/src/proguard.rs +++ b/symbolic-cabi/src/proguard.rs @@ -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 } } diff --git a/symbolic-cfi/src/lib.rs b/symbolic-cfi/src/lib.rs index 7bc69b7a..089a98b8 100644 --- a/symbolic-cfi/src/lib.rs +++ b/symbolic-cfi/src/lib.rs @@ -1198,7 +1198,7 @@ struct CfiCacheV1<'a> { byteview: ByteView<'a>, } -impl<'a> CfiCacheV1<'a> { +impl CfiCacheV1<'_> { pub fn raw(&self) -> &[u8] { &self.byteview } diff --git a/symbolic-debuginfo/src/base.rs b/symbolic-debuginfo/src/base.rs index 256ff2f5..79443727 100644 --- a/symbolic-debuginfo/src/base.rs +++ b/symbolic-debuginfo/src/base.rs @@ -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) @@ -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("")) diff --git a/symbolic-debuginfo/src/breakpad.rs b/symbolic-debuginfo/src/breakpad.rs index 6c91aedb..94e4803c 100644 --- a/symbolic-debuginfo/src/breakpad.rs +++ b/symbolic-debuginfo/src/breakpad.rs @@ -605,7 +605,7 @@ pub struct BreakpadLineRecords<'d> { finished: bool, } -impl<'d> Iterator for BreakpadLineRecords<'d> { +impl Iterator for BreakpadLineRecords<'_> { type Item = Result; fn next(&mut self) -> Option { @@ -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`]. @@ -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()) @@ -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>; diff --git a/symbolic-debuginfo/src/dwarf.rs b/symbolic-debuginfo/src/dwarf.rs index e9d32922..b33bf648 100644 --- a/symbolic-debuginfo/src/dwarf.rs +++ b/symbolic-debuginfo/src/dwarf.rs @@ -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>) -> Option<&'d [u8]> { @@ -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(), @@ -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>; diff --git a/symbolic-debuginfo/src/elf.rs b/symbolic-debuginfo/src/elf.rs index 6ddb2f29..cdaddb4a 100644 --- a/symbolic-debuginfo/src/elf.rs +++ b/symbolic-debuginfo/src/elf.rs @@ -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 { diff --git a/symbolic-debuginfo/src/function_builder.rs b/symbolic-debuginfo/src/function_builder.rs index af1ff4fd..0bc2cad0 100644 --- a/symbolic-debuginfo/src/function_builder.rs +++ b/symbolic-debuginfo/src/function_builder.rs @@ -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 { 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)) } diff --git a/symbolic-debuginfo/src/macho/bcsymbolmap.rs b/symbolic-debuginfo/src/macho/bcsymbolmap.rs index 6a4c15e4..59dbf98a 100644 --- a/symbolic-debuginfo/src/macho/bcsymbolmap.rs +++ b/symbolic-debuginfo/src/macho/bcsymbolmap.rs @@ -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 { diff --git a/symbolic-debuginfo/src/macho/compact.rs b/symbolic-debuginfo/src/macho/compact.rs index db40d21b..716e2de5 100644 --- a/symbolic-debuginfo/src/macho/compact.rs +++ b/symbolic-debuginfo/src/macho/compact.rs @@ -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; diff --git a/symbolic-debuginfo/src/macho/mod.rs b/symbolic-debuginfo/src/macho/mod.rs index 7fd53b39..dc858e78 100644 --- a/symbolic-debuginfo/src/macho/mod.rs +++ b/symbolic-debuginfo/src/macho/mod.rs @@ -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, MachError>; fn next(&mut self) -> Option { @@ -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, MachError>; fn next(&mut self) -> Option { diff --git a/symbolic-debuginfo/src/object.rs b/symbolic-debuginfo/src/object.rs index e3281ce7..1ebb1148 100644 --- a/symbolic-debuginfo/src/object.rs +++ b/symbolic-debuginfo/src/object.rs @@ -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 @@ -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 { @@ -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, ObjectError>; fn next(&mut self) -> Option { diff --git a/symbolic-debuginfo/src/pdb.rs b/symbolic-debuginfo/src/pdb.rs index dd2a24c9..bad07160 100644 --- a/symbolic-debuginfo/src/pdb.rs +++ b/symbolic-debuginfo/src/pdb.rs @@ -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 { diff --git a/symbolic-debuginfo/src/pe.rs b/symbolic-debuginfo/src/pe.rs index 146226e8..c4a37138 100644 --- a/symbolic-debuginfo/src/pe.rs +++ b/symbolic-debuginfo/src/pe.rs @@ -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 { @@ -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 } diff --git a/symbolic-debuginfo/src/ppdb.rs b/symbolic-debuginfo/src/ppdb.rs index 25ae919f..05219f29 100644 --- a/symbolic-debuginfo/src/ppdb.rs +++ b/symbolic-debuginfo/src/ppdb.rs @@ -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>; diff --git a/symbolic-debuginfo/src/sourcebundle.rs b/symbolic-debuginfo/src/sourcebundle.rs index 4ab5d05a..4eeeb8e7 100644 --- a/symbolic-debuginfo/src/sourcebundle.rs +++ b/symbolic-debuginfo/src/sourcebundle.rs @@ -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 { @@ -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>; diff --git a/symbolic-debuginfo/src/wasm.rs b/symbolic-debuginfo/src/wasm.rs index 1454f2f4..a23bc3a3 100644 --- a/symbolic-debuginfo/src/wasm.rs +++ b/symbolic-debuginfo/src/wasm.rs @@ -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 { diff --git a/symbolic-debuginfo/src/wasm/parser.rs b/symbolic-debuginfo/src/wasm/parser.rs index 3ce02f15..183f3091 100644 --- a/symbolic-debuginfo/src/wasm/parser.rs +++ b/symbolic-debuginfo/src/wasm/parser.rs @@ -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; diff --git a/symbolic-demangle/src/lib.rs b/symbolic-demangle/src/lib.rs index b6a3ec03..acc9c3cb 100644 --- a/symbolic-demangle/src/lib.rs +++ b/symbolic-demangle/src/lib.rs @@ -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(); diff --git a/symbolic-ppdb/src/cache/mod.rs b/symbolic-ppdb/src/cache/mod.rs index 6330e9da..d1de297c 100644 --- a/symbolic-ppdb/src/cache/mod.rs +++ b/symbolic-ppdb/src/cache/mod.rs @@ -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) diff --git a/symbolic-ppdb/src/format/metadata.rs b/symbolic-ppdb/src/format/metadata.rs index ee11a7da..88e451b4 100644 --- a/symbolic-ppdb/src/format/metadata.rs +++ b/symbolic-ppdb/src/format/metadata.rs @@ -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 = self .columns @@ -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 @@ -861,7 +861,7 @@ impl<'data> Index for MetadataStream<'data> { } } -impl<'data> IndexMut for MetadataStream<'data> { +impl IndexMut for MetadataStream<'_> { fn index_mut(&mut self, index: TableType) -> &mut Self::Output { &mut self.tables[index as usize] } @@ -910,7 +910,7 @@ macro_rules! ok_or_return { }; } -impl<'data> Iterator for CustomDebugInformationIterator<'data> { +impl Iterator for CustomDebugInformationIterator<'_> { type Item = Result; fn next(&mut self) -> Option { diff --git a/symbolic-ppdb/src/format/mod.rs b/symbolic-ppdb/src/format/mod.rs index 3f9e2dd8..d76847d1 100644 --- a/symbolic-ppdb/src/format/mod.rs +++ b/symbolic-ppdb/src/format/mod.rs @@ -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, FormatError>; fn next(&mut self) -> Option { diff --git a/symbolic-ppdb/src/format/sequence_points.rs b/symbolic-ppdb/src/format/sequence_points.rs index 476dad4e..dd8e4608 100644 --- a/symbolic-ppdb/src/format/sequence_points.rs +++ b/symbolic-ppdb/src/format/sequence_points.rs @@ -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, FormatError>; fn next(&mut self) -> Option { diff --git a/symbolic-sourcemapcache/src/lookup.rs b/symbolic-sourcemapcache/src/lookup.rs index 2f5c6d8d..d1d70e0e 100644 --- a/symbolic-sourcemapcache/src/lookup.rs +++ b/symbolic-sourcemapcache/src/lookup.rs @@ -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) diff --git a/symbolic-symcache/src/lib.rs b/symbolic-symcache/src/lib.rs index 670f03d2..3eddb8a7 100644 --- a/symbolic-symcache/src/lib.rs +++ b/symbolic-symcache/src/lib.rs @@ -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) diff --git a/symbolic-symcache/src/lookup.rs b/symbolic-symcache/src/lookup.rs index 9c1a4f4a..f5eccb1e 100644 --- a/symbolic-symcache/src/lookup.rs +++ b/symbolic-symcache/src/lookup.rs @@ -91,7 +91,7 @@ pub struct File<'data> { name: &'data str, } -impl<'data> File<'data> { +impl File<'_> { /// Returns this file's full path. pub fn full_path(&self) -> String { let comp_dir = self.comp_dir.unwrap_or_default(); @@ -135,7 +135,7 @@ impl<'data> Function<'data> { } } -impl<'data> Default for Function<'data> { +impl Default for Function<'_> { fn default() -> Self { Self { name: "?", @@ -155,7 +155,7 @@ pub struct SourceLocation<'data, 'cache> { pub(crate) source_location: &'data raw::SourceLocation, } -impl<'data, 'cache> SourceLocation<'data, 'cache> { +impl<'data> SourceLocation<'data, '_> { /// The source line corresponding to the instruction. /// /// 0 denotes an unknown line number. diff --git a/symbolic-symcache/src/transform/mod.rs b/symbolic-symcache/src/transform/mod.rs index 1dda2609..453a87ec 100644 --- a/symbolic-symcache/src/transform/mod.rs +++ b/symbolic-symcache/src/transform/mod.rs @@ -58,7 +58,7 @@ pub trait Transformer { #[derive(Default)] pub(crate) struct Transformers<'a>(pub Vec>); -impl<'a> std::fmt::Debug for Transformers<'a> { +impl std::fmt::Debug for Transformers<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let len = self.0.len(); f.debug_tuple("Transformers").field(&len).finish()