From 7f80ccff0c3163a48450c9c69fd7537edc1c6792 Mon Sep 17 00:00:00 2001 From: Kristofer Rye Date: Sun, 14 Apr 2019 19:51:29 -0500 Subject: [PATCH] dump: Clean up the code a bit and make Clippy stop whining Signed-off-by: Kristofer Rye --- src/dump.rs | 4 ++-- src/dump/plugin.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dump.rs b/src/dump.rs index 7573457..948f8f8 100644 --- a/src/dump.rs +++ b/src/dump.rs @@ -18,7 +18,7 @@ pub struct Dump { } impl Dump { - pub fn read(rdr: R) -> Dump { + pub fn read(rdr: R) -> Self { let mut reader = csv::Reader::from_reader(rdr); let mut plugins: HashSet = HashSet::new(); @@ -78,7 +78,7 @@ impl Dump { detections.insert(record_detection); }); - Dump { + Self { filename: "test".to_string(), detections: detections.iter().cloned().collect(), } diff --git a/src/dump/plugin.rs b/src/dump/plugin.rs index 39e4d38..881f473 100644 --- a/src/dump/plugin.rs +++ b/src/dump/plugin.rs @@ -15,7 +15,7 @@ pub struct Plugin { } impl PartialEq for Plugin { - fn eq(&self, other: &Plugin) -> bool { + fn eq(&self, other: &Self) -> bool { let mut s = DefaultHasher::new(); let mut o = DefaultHasher::new(); self.hash(&mut s);