Skip to content

Commit

Permalink
Tweak formatting of netstat example
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Oct 26, 2019
1 parent ac217a9 commit 3222e45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/netstat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ fn main() {
let state = format!("{:?}", entry.state);
if let Some(process) = map.get(&entry.inode) {
println!(
"{:<26} {:<26} {:<15} {:<8} {}/{}",
"{:<26} {:<26} {:<15} {:<12} {}/{}",
local_address, remote_addr, state, entry.inode, process.stat.pid, process.stat.comm
);
} else {
// We might not always be able to find the process assocated with this socket
println!(
"{:<26} {:<26} {:<15} {:<8} -",
"{:<26} {:<26} {:<15} {:<12} -",
local_address, remote_addr, state, entry.inode
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
//! let remote_addr = format!("{}", entry.remote_address);
//! let state = format!("{:?}", entry.state);
//! if let Some(process) = map.get(&entry.inode) {
//! println!("{:<26} {:<26} {:<15} {:<8} {}/{}", local_address, remote_addr, state, entry.inode, process.stat.pid, process.stat.comm);
//! println!("{:<26} {:<26} {:<15} {:<12} {}/{}", local_address, remote_addr, state, entry.inode, process.stat.pid, process.stat.comm);
//! } else {
//! // We might not always be able to find the process assocated with this socket
//! println!("{:<26} {:<26} {:<15} {:<8} -", local_address, remote_addr, state, entry.inode);
//! println!("{:<26} {:<26} {:<15} {:<12} -", local_address, remote_addr, state, entry.inode);
//! }
//! }
use crate::ProcResult;
Expand Down

0 comments on commit 3222e45

Please sign in to comment.