Skip to content

Commit

Permalink
Clippify
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspustina committed Mar 24, 2020
1 parent c695a03 commit 3db8142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,8 @@ fn run_to_scanned_hosts_by_ip(nmap_run: &Run) -> BTreeMap<&IpAddr, &nmap::Host>
let mut shbi = BTreeMap::new();
for host in &nmap_run.hosts {
for address in &host.addresses {
match address {
Address::IpV4 { ref addr } => {
shbi.insert(addr, host);
}
_ => {}
if let Address::IpV4{ ref addr } = address {
shbi.insert(addr, host);
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ pub use portspec::PortSpecs;

use serde::de::{self, Deserialize, Deserializer};
use std::fmt::Display;
use std::fs::File;
use std::io::Read;
use std::fs;
use std::path::Path;
use std::str::FromStr;

Expand Down Expand Up @@ -59,9 +58,7 @@ pub trait FromFile {
) -> ::std::result::Result<String, ::std::io::Error> {
let path: &Path = path.as_ref();

let mut file = File::open(path)?;
let mut contents = String::new();
let _ = file.read_to_string(&mut contents)?;
let contents = fs::read_to_string(path)?;

Ok(contents)
}
Expand Down

0 comments on commit 3db8142

Please sign in to comment.