Skip to content

Commit 44b6bf0

Browse files
committed
chore(clippy): resolve clippy warnings
1 parent ef0fbbd commit 44b6bf0

File tree

10 files changed

+24
-30
lines changed

10 files changed

+24
-30
lines changed

src/bin/adlt/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5555
o!("version"=>clap::crate_version!(), "log_level"=>format!("{}",min_log_level)),
5656
);
5757

58-
return match matches.subcommand() {
58+
match matches.subcommand() {
5959
Some(("convert", sub_m)) => {
6060
convert::convert(&log, sub_m, std::io::BufWriter::new(std::io::stdout()))
6161
.map_err(|e| e.into())
6262
.map(|_x| ())
6363
} // dont return anything here
6464
Some(("remote", sub_m)) => remote::remote(&log, sub_m, false),
65-
_ => {
66-
return Err(Box::new(io::Error::new(
67-
io::ErrorKind::Unsupported,
68-
"unknown subcommand",
69-
)));
70-
}
71-
};
65+
_ => Err(Box::new(io::Error::new(
66+
io::ErrorKind::Unsupported,
67+
"unknown subcommand",
68+
))),
69+
}
7270
// return Ok(());
7371
/*
7472
let input_file_name = matches.value_of("file").unwrap();

src/bin/adlt/remote.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ fn file_names_to_file_streams(
615615
/// - change the window for an existing stream
616616
/// - `plugin_cmd`
617617
/// - execute a command for a plugin (e.g. FileTransfer save file)
618-
619618
fn process_incoming_text_message<T: Read + Write>(
620619
log: &slog::Logger,
621620
t: String,
@@ -2699,7 +2698,6 @@ mod tests {
26992698
/// test a remote "open" command with 'collect:"one_pass_streams"' that can be used to
27002699
/// use streams that cannot be seeked, searched,... but no messages are collected
27012700
/// so it has little memory usage and is used e.g. by fba-cli to execute once all fishbone queries
2702-
27032701
fn process_file_context_one_pass_streams() {
27042702
let log = new_logger();
27052703
let port = pick_unused_port().expect("no ports free");

src/serde_verb_payload/ser_verb_payload.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ macro_rules! dlt_args {
5757
};
5858
}
5959

60-
impl<'a> ser::Serializer for &'a mut Serializer {
60+
impl ser::Serializer for &mut Serializer {
6161
// The output type produced by this `Serializer` during successful
6262
// serialization. Most serializers that produce text or binary output should
6363
// set `Ok = ()` and serialize into an `io::Write` or buffer contained
@@ -335,7 +335,7 @@ impl<'a> ser::Serializer for &'a mut Serializer {
335335
//
336336
// This impl is SerializeSeq so these methods are called after `serialize_seq`
337337
// is called on the Serializer.
338-
impl<'a> ser::SerializeSeq for &'a mut Serializer {
338+
impl ser::SerializeSeq for &mut Serializer {
339339
// Must match the `Ok` type of the serializer.
340340
type Ok = ();
341341
// Must match the `Error` type of the serializer.
@@ -360,7 +360,7 @@ impl<'a> ser::SerializeSeq for &'a mut Serializer {
360360
}
361361

362362
// Same thing but for tuples.
363-
impl<'a> ser::SerializeTuple for &'a mut Serializer {
363+
impl ser::SerializeTuple for &mut Serializer {
364364
type Ok = ();
365365
type Error = Error;
366366

@@ -381,7 +381,7 @@ impl<'a> ser::SerializeTuple for &'a mut Serializer {
381381
}
382382

383383
// Same thing but for tuple structs.
384-
impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
384+
impl ser::SerializeTupleStruct for &mut Serializer {
385385
type Ok = ();
386386
type Error = Error;
387387

@@ -410,7 +410,7 @@ impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
410410
//
411411
// So the `end` method in this impl is responsible for closing both the `]` and
412412
// the `}`.
413-
impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
413+
impl ser::SerializeTupleVariant for &mut Serializer {
414414
type Ok = ();
415415
type Error = Error;
416416

@@ -438,7 +438,7 @@ impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
438438
// `serialize_entry` method allows serializers to optimize for the case where
439439
// key and value are both available simultaneously. In JSON it doesn't make a
440440
// difference so the default behavior for `serialize_entry` is fine.
441-
impl<'a> ser::SerializeMap for &'a mut Serializer {
441+
impl ser::SerializeMap for &mut Serializer {
442442
type Ok = ();
443443
type Error = Error;
444444

@@ -479,7 +479,7 @@ impl<'a> ser::SerializeMap for &'a mut Serializer {
479479

480480
// Structs are like maps in which the keys are constrained to be compile-time
481481
// constant strings.
482-
impl<'a> ser::SerializeStruct for &'a mut Serializer {
482+
impl ser::SerializeStruct for &mut Serializer {
483483
type Ok = ();
484484
type Error = Error;
485485

@@ -501,7 +501,7 @@ impl<'a> ser::SerializeStruct for &'a mut Serializer {
501501
}
502502
}
503503

504-
impl<'a> ser::SerializeStructVariant for &'a mut Serializer {
504+
impl ser::SerializeStructVariant for &mut Serializer {
505505
type Ok = ();
506506
type Error = Error;
507507

src/utils/asc2dltmsgiterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ fn parse_signed_time_str(timestamp: &str) -> i64 {
224224
}
225225
}
226226

227-
impl<'a, R> Iterator for Asc2DltMsgIterator<'a, R>
227+
impl<R> Iterator for Asc2DltMsgIterator<'_, R>
228228
where
229229
R: BufRead,
230230
{

src/utils/blf2dltmsgiterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl<'a, R: BufRead + Seek> BLF2DltMsgIterator<'a, R> {
330330
}
331331
}
332332

333-
impl<'a, R> Iterator for BLF2DltMsgIterator<'a, R>
333+
impl<R> Iterator for BLF2DltMsgIterator<'_, R>
334334
where
335335
R: BufRead + Seek,
336336
{

src/utils/dltmessageiterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'a, R> DltMessageIterator<'a, R> {
3030
}
3131
}
3232

33-
impl<'a, R> Iterator for DltMessageIterator<'a, R>
33+
impl<R> Iterator for DltMessageIterator<'_, R>
3434
where
3535
R: BufRead,
3636
{

src/utils/genlog2dltmsgiterator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use std::{
1818
/// a reader/parser for generic (text) log files to DLT msgs
1919
///
2020
/// Needed: an absolute timestamp, a log level, a tag and a log message
21-
2221
pub struct GenLog2DltMsgIterator<'a, R> {
2322
lines: Lines<R>,
2423
pub index: DltMessageIndexType,
@@ -190,7 +189,7 @@ impl<'a, R: BufRead> GenLog2DltMsgIterator<'a, R> {
190189
}
191190
}
192191

193-
impl<'a, R: BufRead> Iterator for GenLog2DltMsgIterator<'a, R> {
192+
impl<R: BufRead> Iterator for GenLog2DltMsgIterator<'_, R> {
194193
type Item = DltMessage;
195194
fn next(&mut self) -> Option<Self::Item> {
196195
if let Some(msg) = self.msgs_deque.pop_front() {

src/utils/logcat2dltmsgiterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ lazy_static! {
291291

292292
}
293293

294-
impl<'a, R> Iterator for LogCat2DltMsgIterator<'a, R>
294+
impl<R> Iterator for LogCat2DltMsgIterator<'_, R>
295295
where
296296
R: BufRead,
297297
{

src/utils/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ pub struct DltFileInfos {
282282
/// assert!(dfi.first_msg.is_some());
283283
/// assert!(dfi.ecus_seen.contains(&DltChar4::from_buf(b"CAN1")));
284284
/// ```
285-
286285
pub fn get_dlt_infos_from_file(
287286
file_ext: &str,
288287
file: &mut std::fs::File,

src/utils/sorting_multi_readeriterator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ struct MinHeapEntry<'a> {
77
it: Box<dyn Iterator<Item = DltMessage> + 'a>,
88
}
99

10-
impl<'a> Ord for MinHeapEntry<'a> {
10+
impl Ord for MinHeapEntry<'_> {
1111
fn cmp(&self, other: &Self) -> Ordering {
1212
// self.m.reception_time_us.cmp(&other.m.reception_time_us) // regular, we do need reverse
1313
other.m.reception_time_us.cmp(&self.m.reception_time_us) // reversed
1414
}
1515
}
1616

17-
impl<'a> PartialOrd for MinHeapEntry<'a> {
17+
impl PartialOrd for MinHeapEntry<'_> {
1818
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
1919
Some(self.cmp(other))
2020
}
2121
}
22-
impl<'a> PartialEq for MinHeapEntry<'a> {
22+
impl PartialEq for MinHeapEntry<'_> {
2323
fn eq(&self, other: &Self) -> bool {
2424
self.m.reception_time_us == other.m.reception_time_us
2525
}
2626
}
27-
impl<'a> Eq for MinHeapEntry<'a> {}
27+
impl Eq for MinHeapEntry<'_> {}
2828

2929
/// Iterator that processes other iterators in "parallel"
3030
/// i.e. it merges the msgs by reception time.
@@ -74,7 +74,7 @@ impl<'a> SortingMultiReaderIterator<'a> {
7474
}
7575
}
7676

77-
impl<'a> Iterator for SortingMultiReaderIterator<'a> {
77+
impl Iterator for SortingMultiReaderIterator<'_> {
7878
type Item = DltMessage;
7979
fn next(&mut self) -> Option<Self::Item> {
8080
let heap_entry = self.min_heap.pop();

0 commit comments

Comments
 (0)