diff --git a/examples/pdb2hpp.rs b/examples/pdb2hpp.rs index e7638a9..8fa60f6 100644 --- a/examples/pdb2hpp.rs +++ b/examples/pdb2hpp.rs @@ -5,8 +5,8 @@ use pdb::FallibleIterator; type TypeSet = BTreeSet; -pub fn type_name<'p>( - type_finder: &pdb::TypeFinder<'p>, +pub fn type_name( + type_finder: &pdb::TypeFinder<'_>, type_index: pdb::TypeIndex, needed_types: &mut TypeSet, ) -> pdb::Result { @@ -357,8 +357,8 @@ impl<'p> Method<'p> { } } -fn argument_list<'p>( - type_finder: &pdb::TypeFinder<'p>, +fn argument_list( + type_finder: &pdb::TypeFinder<'_>, type_index: pdb::TypeIndex, needed_types: &mut TypeSet, ) -> pdb::Result> { diff --git a/src/common.rs b/src/common.rs index 893a857..f5953d7 100644 --- a/src/common.rs +++ b/src/common.rs @@ -14,7 +14,7 @@ use std::result; use std::slice; use scroll::ctx::TryFromCtx; -use scroll::{self, Endian, Pread, LE}; +use scroll::{Endian, Pread, LE}; use crate::tpi::constants; @@ -581,7 +581,7 @@ pub trait ItemIndex: /// [`ModuleInfo`](crate::ModuleInfo). Note that this comparison needs to be done /// case-insensitively as the name in the DBI stream and name table are known to not /// have matching cases. - /// 4. Resolve the [`Local`](crate::Local) index into a global one using + /// 4. Resolve the [`Local`] index into a global one using /// [`CrossModuleExports`](crate::CrossModuleExports). /// /// Cross module references are specially formatted indexes with the most significant bit set to diff --git a/src/modi/c13.rs b/src/modi/c13.rs index 645d0b0..223bb99 100644 --- a/src/modi/c13.rs +++ b/src/modi/c13.rs @@ -6,8 +6,8 @@ use scroll::{ctx::TryFromCtx, Endian, Pread}; use crate::common::*; use crate::modi::{ - constants, CrossModuleExport, CrossModuleRef, FileChecksum, FileIndex, FileInfo, LineInfo, - LineInfoKind, ModuleRef, + constants, CrossModuleExport, CrossModuleRef, FileChecksum, FileInfo, LineInfo, LineInfoKind, + ModuleRef, }; use crate::symbol::{BinaryAnnotation, BinaryAnnotationsIter, InlineSiteSymbol}; use crate::FallibleIterator; @@ -345,6 +345,7 @@ enum LineEntry { /// Declares a source line number. Number(LineNumberEntry), /// Declares a debugging marker. + #[allow(dead_code)] // reason = "the inner `LineMarkerEntry` is not (yet) accessed" Marker(LineMarkerEntry), } @@ -1418,8 +1419,6 @@ impl<'a> LineProgram<'a> { mod tests { use super::*; - use std::mem; - use crate::symbol::BinaryAnnotations; #[test] diff --git a/src/modi/mod.rs b/src/modi/mod.rs index cdb2372..c0e2dc7 100644 --- a/src/modi/mod.rs +++ b/src/modi/mod.rs @@ -49,7 +49,7 @@ impl<'s> ModuleInfo<'s> { } fn lines_data(&self, size: usize) -> &[u8] { - let start = self.symbols_size as usize; + let start = self.symbols_size; &self.stream[start..start + size] } diff --git a/src/msf/mod.rs b/src/msf/mod.rs index e00ca44..eb2e348 100644 --- a/src/msf/mod.rs +++ b/src/msf/mod.rs @@ -293,7 +293,7 @@ mod big { let _ = stream_table.take((stream_count - stream_number - 1) as usize * 4)?; // skip the preceding streams' page numbers - let _ = stream_table.take((page_numbers_to_skip as usize) * 4)?; + let _ = stream_table.take(page_numbers_to_skip * 4)?; // we're now at the list of pages for our stream // accumulate them into a PageList diff --git a/src/msf/page_list.rs b/src/msf/page_list.rs index 88570b6..e5eace9 100644 --- a/src/msf/page_list.rs +++ b/src/msf/page_list.rs @@ -99,7 +99,6 @@ impl PageList { #[cfg(test)] mod tests { use crate::msf::page_list::*; - use crate::source::SourceSlice; #[test] fn test_push() { diff --git a/src/omap.rs b/src/omap.rs index a37c061..7b6326e 100644 --- a/src/omap.rs +++ b/src/omap.rs @@ -77,7 +77,7 @@ impl fmt::Debug for OMAPRecord { impl PartialOrd for OMAPRecord { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - self.source_address().partial_cmp(&other.source_address()) + Some(self.cmp(other)) } } @@ -577,8 +577,6 @@ impl PdbInternalSectionOffset { mod tests { use super::*; - use std::mem; - #[test] fn test_omap_record() { assert_eq!(mem::size_of::(), 8); diff --git a/src/tpi/data.rs b/src/tpi/data.rs index ed7d987..29eb878 100644 --- a/src/tpi/data.rs +++ b/src/tpi/data.rs @@ -166,7 +166,7 @@ pub(crate) fn parse_type_data<'t>(buf: &mut ParseBuffer<'t>) -> Result