Skip to content

Commit 4dab79b

Browse files
committed
Misc clippy lints
1 parent 88f2956 commit 4dab79b

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

plugins/pdb-ng/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl PDBParser {
540540

541541
impl CustomDebugInfoParser for PDBParser {
542542
fn is_valid(&self, view: &BinaryView) -> bool {
543-
view.type_name().to_string() == "PE" || is_pdb(view)
543+
view.type_name() == "PE" || is_pdb(view)
544544
}
545545

546546
fn parse_info(

plugins/pdb-ng/src/type_parser.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,9 +1759,8 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
17591759
structure.width(data.size);
17601760

17611761
self.namespace_stack.push(union_name.to_string());
1762-
let success = self.parse_union_fields(&mut structure, data.fields, finder);
1762+
let _success = self.parse_union_fields(&mut structure, data.fields, finder);
17631763
self.namespace_stack.pop();
1764-
let _ = success?;
17651764

17661765
let new_type = Type::structure(structure.finalize().as_ref());
17671766
Ok(Some(Box::new(ParsedType::Named(union_name, new_type))))
@@ -2015,7 +2014,11 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
20152014
// for some reason
20162015
if let Some(raw_name) = Self::type_data_to_raw_name(&parsed) {
20172016
if let Some(&full_index) = self.full_type_indices.get(&raw_name) {
2018-
if let None = self.type_stack.iter().find(|&&idx| idx == full_index)
2017+
if self
2018+
.type_stack
2019+
.iter()
2020+
.find(|&&idx| idx == full_index)
2021+
.is_none()
20192022
{
20202023
if full_index != index {
20212024
return self.try_type_index_to_bare(
@@ -2050,8 +2053,11 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
20502053
// for some reason
20512054
if let Some(raw_name) = Self::type_data_to_raw_name(&parsed) {
20522055
if let Some(&full_index) = self.full_type_indices.get(&raw_name) {
2053-
if let None =
2054-
self.type_stack.iter().find(|&&idx| idx == full_index)
2056+
if self
2057+
.type_stack
2058+
.iter()
2059+
.find(|&&idx| idx == full_index)
2060+
.is_none()
20552061
{
20562062
if full_index != index {
20572063
return self.try_type_index_to_bare(

rust/src/function.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use crate::variable::{
4949
use crate::workflow::Workflow;
5050
use std::fmt::{Debug, Formatter};
5151
use std::ptr::NonNull;
52-
use std::time::{Duration, UNIX_EPOCH};
52+
use std::time::Duration;
5353
use std::{ffi::c_char, hash::Hash, ops::Range};
5454

5555
/// Used to describe a location within a [`Function`].
@@ -2520,6 +2520,7 @@ pub struct PerformanceInfo {
25202520
pub seconds: Duration,
25212521
}
25222522

2523+
#[allow(unused)]
25232524
impl PerformanceInfo {
25242525
pub fn new(name: String, seconds: Duration) -> Self {
25252526
Self {

rust/src/low_level_il/block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ where
5151
}
5252
}
5353

54-
impl<'func, M, F> Debug for LowLevelILBlock<'func, M, F>
54+
impl<M, F> Debug for LowLevelILBlock<'_, M, F>
5555
where
5656
M: FunctionMutability,
5757
F: FunctionForm,
@@ -63,7 +63,7 @@ where
6363
}
6464
}
6565

66-
impl<'func, M, F> Clone for LowLevelILBlock<'func, M, F>
66+
impl<M, F> Clone for LowLevelILBlock<'_, M, F>
6767
where
6868
M: FunctionMutability,
6969
F: FunctionForm,

rust/src/low_level_il/expression.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ where
9191
}
9292
}
9393

94-
impl<'func, M, F, R> fmt::Debug for LowLevelILExpression<'func, M, F, R>
94+
impl<M, F, R> Debug for LowLevelILExpression<'_, M, F, R>
9595
where
9696
M: FunctionMutability,
9797
F: FunctionForm,
@@ -202,7 +202,7 @@ where
202202
}
203203
}
204204

205-
impl<'func, F> LowLevelILExpression<'func, Finalized, F, ValueExpr>
205+
impl<F> LowLevelILExpression<'_, Finalized, F, ValueExpr>
206206
where
207207
F: FunctionForm,
208208
{
@@ -650,7 +650,7 @@ where
650650
}
651651
}
652652

653-
impl<'func> LowLevelILExpressionKind<'func, Mutable, NonSSA<LiftedNonSSA>> {
653+
impl LowLevelILExpressionKind<'_, Mutable, NonSSA<LiftedNonSSA>> {
654654
pub fn flag_write(&self) -> Option<CoreFlagWrite> {
655655
use self::LowLevelILExpressionKind::*;
656656

rust/src/low_level_il/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ where
100100
}
101101
}
102102

103-
impl<'func, M, F> Debug for LowLevelILInstruction<'func, M, F>
103+
impl<M, F> Debug for LowLevelILInstruction<'_, M, F>
104104
where
105105
M: FunctionMutability,
106106
F: FunctionForm,

rust/src/low_level_il/lifting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ impl<'a> LiftableLowLevelILWithSize<'a>
667667
}
668668
}
669669

670-
impl<'func, R> LowLevelILExpression<'func, Mutable, NonSSA<LiftedNonSSA>, R>
670+
impl<R> LowLevelILExpression<'_, Mutable, NonSSA<LiftedNonSSA>, R>
671671
where
672672
R: ExpressionResultType,
673673
{

0 commit comments

Comments
 (0)