Skip to content

Commit 7115bd4

Browse files
Fix some clippy warnings
1 parent 3b46004 commit 7115bd4

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

src/config/permissions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<'de> Deserialize<'de> for PermSel {
361361

362362
struct PermSelVisitor;
363363

364-
impl<'de> serde::de::Visitor<'de> for PermSelVisitor {
364+
impl serde::de::Visitor<'_> for PermSelVisitor {
365365
type Value = PermSel;
366366

367367
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>

src/cowarc.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub(crate) enum CowArc<'data, T: ?Sized> {
2020
Borrowed(&'data T),
2121
}
2222

23-
impl<'data, T: ?Sized> CowArc<'data, T> {
23+
impl<T: ?Sized> CowArc<'_, T> {
2424
/// Returns a reference to the data contained within. Note that the returned reference is valid
2525
/// for the lifetime of `self`, not for 'data, since if we're stored on the heap, we can't
2626
/// provide a reference that's valid for 'data, which may be longer (and likely 'static).
@@ -32,7 +32,7 @@ impl<'data, T: ?Sized> CowArc<'data, T> {
3232
}
3333
}
3434

35-
impl<'data, T: ?Sized> Clone for CowArc<'data, T> {
35+
impl<T: ?Sized> Clone for CowArc<'_, T> {
3636
fn clone(&self) -> Self {
3737
match self {
3838
Self::Heap(arg0) => Self::Heap(Arc::clone(arg0)),
@@ -41,7 +41,7 @@ impl<'data, T: ?Sized> Clone for CowArc<'data, T> {
4141
}
4242
}
4343

44-
impl<'data, V: Clone> CowArc<'data, [V]> {
44+
impl<V: Clone> CowArc<'_, [V]> {
4545
/// Create an instance that is heap-allocated and reference counted and thus can be used beyond
4646
/// the lifetime 'data.
4747
pub(crate) fn to_heap(&self) -> CowArc<'static, [V]> {
@@ -52,7 +52,7 @@ impl<'data, V: Clone> CowArc<'data, [V]> {
5252
}
5353
}
5454

55-
impl<'data> CowArc<'data, str> {
55+
impl CowArc<'_, str> {
5656
/// Create an instance that is heap-allocated and reference counted and thus can be used beyond
5757
/// the lifetime 'data.
5858
pub(crate) fn to_heap(&self) -> CowArc<'static, str> {
@@ -63,35 +63,35 @@ impl<'data> CowArc<'data, str> {
6363
}
6464
}
6565

66-
impl<'data, T: ?Sized> Deref for CowArc<'data, T> {
66+
impl<T: ?Sized> Deref for CowArc<'_, T> {
6767
type Target = T;
6868

6969
fn deref(&self) -> &Self::Target {
7070
self.data()
7171
}
7272
}
7373

74-
impl<'data, T: PartialEq + ?Sized> PartialEq for CowArc<'data, T> {
74+
impl<T: PartialEq + ?Sized> PartialEq for CowArc<'_, T> {
7575
fn eq(&self, other: &Self) -> bool {
7676
self.data().eq(other.data())
7777
}
7878
}
7979

80-
impl<'data, T: Hash + ?Sized> Hash for CowArc<'data, T> {
80+
impl<T: Hash + ?Sized> Hash for CowArc<'_, T> {
8181
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
8282
self.data().hash(state);
8383
}
8484
}
8585

86-
impl<'data, T: PartialOrd + ?Sized> PartialOrd for CowArc<'data, T> {
86+
impl<T: PartialOrd + ?Sized> PartialOrd for CowArc<'_, T> {
8787
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
8888
self.data().partial_cmp(other.data())
8989
}
9090
}
9191

92-
impl<'data, T: Eq + ?Sized> Eq for CowArc<'data, T> {}
92+
impl<T: Eq + ?Sized> Eq for CowArc<'_, T> {}
9393

94-
impl<'data, T: Ord + ?Sized> Ord for CowArc<'data, T> {
94+
impl<T: Ord + ?Sized> Ord for CowArc<'_, T> {
9595
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
9696
self.data().cmp(other.data())
9797
}

src/crate_index/lib_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct LibTreeBuilder<'a> {
4141
pkg_name_to_ids: &'a FxHashMap<Arc<str>, Vec<PackageId>>,
4242
}
4343

44-
impl<'a> LibTreeBuilder<'a> {
44+
impl LibTreeBuilder<'_> {
4545
fn build(mut self, dir: &Path) -> Result<LibTree> {
4646
let output = Command::new("cargo")
4747
.current_dir(dir)

src/names.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Namespace {
8181
}
8282
}
8383

84-
impl<'input> DebugName<'input> {
84+
impl DebugName<'_> {
8585
pub(crate) fn names_iterator(&self) -> NamesIterator<NonMangledIterator> {
8686
NamesIterator::new(NonMangledIterator::new(
8787
&self.namespace.parts,
@@ -186,7 +186,7 @@ pub(crate) struct NamePartsIterator<'it, 'data, I: Clone + Iterator<Item = Deman
186186
ended: bool,
187187
}
188188

189-
impl<'it, 'data, I> Iterator for NamePartsIterator<'it, 'data, I>
189+
impl<'data, I> Iterator for NamePartsIterator<'_, 'data, I>
190190
where
191191
I: Clone + Iterator<Item = DemangleToken<'data>>,
192192
{
@@ -207,7 +207,7 @@ where
207207
}
208208
}
209209

210-
impl<'it, 'data, I> Drop for NamePartsIterator<'it, 'data, I>
210+
impl<'data, I> Drop for NamePartsIterator<'_, 'data, I>
211211
where
212212
I: Clone + Iterator<Item = DemangleToken<'data>>,
213213
{
@@ -343,7 +343,7 @@ impl<'data, I: Clone + Iterator<Item = DemangleToken<'data>>> Iterator
343343
}
344344
}
345345

346-
impl<'input> DebugName<'input> {
346+
impl DebugName<'_> {
347347
pub(crate) fn to_heap(&self) -> DebugName<'static> {
348348
DebugName {
349349
namespace: self.namespace.clone(),
@@ -377,7 +377,7 @@ enum NamesIteratorState<I> {
377377
},
378378
}
379379

380-
impl<'input> SymbolAndName<'input> {
380+
impl SymbolAndName<'_> {
381381
pub(crate) fn symbol_or_debug_name(&self) -> Result<SymbolOrDebugName> {
382382
if let Some(debug_name) = self.debug_name.as_ref() {
383383
return Ok(SymbolOrDebugName::DebugName(debug_name.to_heap()));
@@ -396,7 +396,7 @@ impl Display for Name {
396396
}
397397
}
398398

399-
impl<'input> Display for SymbolAndName<'input> {
399+
impl Display for SymbolAndName<'_> {
400400
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
401401
if let Some(name) = self.debug_name.as_ref() {
402402
Display::fmt(&name, f)?;
@@ -428,7 +428,7 @@ impl Display for Namespace {
428428
}
429429
}
430430

431-
impl<'input> Display for DebugName<'input> {
431+
impl Display for DebugName<'_> {
432432
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
433433
Display::fmt(&self.namespace, f)?;
434434
if !self.namespace.is_empty() {

src/proxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub(crate) fn clean(dir: &Path, args: &Args, config: &CommonConfig) -> Result<()
9090
Ok(())
9191
}
9292

93-
impl<'a> CargoRunner<'a> {
93+
impl CargoRunner<'_> {
9494
/// Invokes `cargo build` in the specified directory with us acting as proxy versions of rustc
9595
/// and the linker. If calling this, you must call handle_wrapped_binaries from the start of
9696
/// main.

src/symbol.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) struct Symbol<'data> {
1515
bytes: Bytes<'data>,
1616
}
1717

18-
impl<'data> Symbol<'data> {
18+
impl Symbol<'_> {
1919
pub(crate) fn borrowed(data: &[u8]) -> Symbol {
2020
Symbol {
2121
bytes: Bytes::Borrowed(data),
@@ -86,7 +86,7 @@ impl<'data> Symbol<'data> {
8686
}
8787
}
8888

89-
impl<'data> Display for Symbol<'data> {
89+
impl Display for Symbol<'_> {
9090
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9191
if let Ok(sym_string) = self.to_str() {
9292
write!(f, "{:#}", demangle(sym_string))?;
@@ -97,7 +97,7 @@ impl<'data> Display for Symbol<'data> {
9797
}
9898
}
9999

100-
impl<'data> Debug for Symbol<'data> {
100+
impl Debug for Symbol<'_> {
101101
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
102102
if let Ok(sym_string) = self.to_str() {
103103
// For valid UTF-8, we just print as a string. We want something that fits on one line,

src/symbol_graph.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl ScanOutputs {
249249
}
250250
}
251251

252-
impl<'input, 'backtracer> ApiUsageCollector<'input, 'backtracer> {
252+
impl<'input> ApiUsageCollector<'input, '_> {
253253
fn process_file(
254254
&mut self,
255255
filename: &Path,
@@ -552,7 +552,7 @@ enum LocationFetcher<'a> {
552552
AlreadyResolved(&'a SourceLocation),
553553
}
554554

555-
impl<'a> LocationFetcher<'a> {
555+
impl LocationFetcher<'_> {
556556
fn location(&self) -> Result<SourceLocation> {
557557
match self {
558558
LocationFetcher::FrameWithFallback {
@@ -698,7 +698,7 @@ impl<'symbol, 'input: 'symbol> BinInfo<'input> {
698698
}
699699
}
700700

701-
impl<'a> TryFrom<&addr2line::Location<'a>> for SourceLocation {
701+
impl TryFrom<&addr2line::Location<'_>> for SourceLocation {
702702
type Error = ();
703703
fn try_from(value: &addr2line::Location) -> std::result::Result<Self, ()> {
704704
let addr2line::Location {
@@ -713,7 +713,7 @@ impl<'a> TryFrom<&addr2line::Location<'a>> for SourceLocation {
713713
}
714714
}
715715

716-
impl<'input> BinInfo<'input> {
716+
impl BinInfo<'_> {
717717
/// Runs `callback` for each name in `symbol` or in the name obtained for the debug information
718718
/// for `symbol`. Also supplies information about the name source and a set of APIs that match
719719
/// the name.
@@ -785,7 +785,7 @@ pub(crate) enum NameSource<'symbol> {
785785
DebugName(DebugName<'static>),
786786
}
787787

788-
impl<'symbol> NameSource<'symbol> {
788+
impl NameSource<'_> {
789789
fn to_owned(&self) -> NameSource<'static> {
790790
match self {
791791
NameSource::Symbol(symbol) => NameSource::Symbol(symbol.to_heap()),
@@ -794,7 +794,7 @@ impl<'symbol> NameSource<'symbol> {
794794
}
795795
}
796796

797-
impl<'symbol> Display for NameSource<'symbol> {
797+
impl Display for NameSource<'_> {
798798
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
799799
match self {
800800
NameSource::Symbol(symbol) => symbol.fmt(f),

src/symbol_graph/dwarf.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) struct InlinedFunction<'input> {
4747
pub(crate) call_location: CallLocation<'input>,
4848
}
4949

50-
impl<'input> CallLocation<'input> {
50+
impl CallLocation<'_> {
5151
pub(crate) fn location(&self) -> Result<SourceLocation> {
5252
let line = self
5353
.line
@@ -254,7 +254,7 @@ struct UnitState<'input, 'dwarf> {
254254
subprogram_namespaces: FxHashMap<UnitOffset, Namespace>,
255255
}
256256

257-
impl<'input, 'dwarf> UnitState<'input, 'dwarf> {
257+
impl<'input> UnitState<'input, '_> {
258258
fn attr_string(
259259
&self,
260260
attr: AttributeValue<EndianSlice<'input, LittleEndian>, usize>,
@@ -303,14 +303,14 @@ impl<'input, 'dwarf> UnitState<'input, 'dwarf> {
303303
match attr.value() {
304304
AttributeValue::UnitRef(unit_offset) => {
305305
let unit = self.unit;
306-
return self.get_symbol_and_name_in_unit(unit, unit_offset, max_depth, scanner);
306+
self.get_symbol_and_name_in_unit(unit, unit_offset, max_depth, scanner)
307307
}
308308
AttributeValue::DebugInfoRef(offset) => {
309309
let unit = scanner.unit_containing(offset)?;
310310
let unit_offset = offset
311311
.to_unit_offset(&unit.header)
312312
.ok_or_else(|| anyhow!("Invalid unit offset"))?;
313-
return self.get_symbol_and_name_in_unit(unit, unit_offset, max_depth, scanner);
313+
self.get_symbol_and_name_in_unit(unit, unit_offset, max_depth, scanner)
314314
}
315315
_ => {
316316
bail!("Unsupported abstract_origin type: {:?}", attr.value());
@@ -403,7 +403,7 @@ struct DwarfScanner<'input> {
403403
units: Vec<gimli::Unit<EndianSlice<'input, LittleEndian>>>,
404404
}
405405

406-
impl<'input> SymbolDebugInfo<'input> {
406+
impl SymbolDebugInfo<'_> {
407407
pub(crate) fn source_location(&self) -> SourceLocation {
408408
let mut filename = self.compdir.to_owned();
409409
if let Some(directory) = self.directory {

0 commit comments

Comments
 (0)