summaryrefslogtreecommitdiffstats
path: root/src/os/lsof_utils.rs
diff options
context:
space:
mode:
authorKelvin Zhang <zhangxp1998@gmail.com>2020-01-06 18:04:26 -0500
committerKelvin Zhang <zhangxp1998@gmail.com>2020-01-07 16:27:45 -0500
commitcf772acba35467b25ab59fef644199839882bc4a (patch)
tree73a43f63d1e947e707c54991b59bb1d393db11b3 /src/os/lsof_utils.rs
parent9737ba98c01f3198e916c54f437801e12cce440d (diff)
Format code using rustfmt
Diffstat (limited to 'src/os/lsof_utils.rs')
-rw-r--r--src/os/lsof_utils.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/os/lsof_utils.rs b/src/os/lsof_utils.rs
index 4464abc..260c753 100644
--- a/src/os/lsof_utils.rs
+++ b/src/os/lsof_utils.rs
@@ -18,8 +18,7 @@ pub struct RawConnection {
lazy_static! {
static ref CONNECTION_REGEX: Regex =
Regex::new(r"\[?([^\s\]]*)\]?:(\d+)->\[?([^\s\]]*)\]?:(\d+)").unwrap();
- static ref LISTEN_REGEX: Regex =
- Regex::new(r"(.*):(.*)").unwrap();
+ static ref LISTEN_REGEX: Regex = Regex::new(r"(.*):(.*)").unwrap();
}
fn parse_ip_addr(ip: &str) -> IpAddr {
@@ -45,7 +44,11 @@ impl RawConnection {
pub fn new(raw_line: &str) -> Option<RawConnection> {
let columns: Vec<&str> = raw_line.split_ascii_whitespace().collect();
if columns.len() < 9 {
- println!("lsof's output string has {} columns, different than expected: {:#?}", columns.len(), columns);
+ println!(
+ "lsof's output string has {} columns, different than expected: {:#?}",
+ columns.len(),
+ columns
+ );
return None;
}
let process_name = columns[0].replace("\\x20", " ");