Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
28
vendor/procfs/examples/mountinfo.rs
vendored
Normal file
28
vendor/procfs/examples/mountinfo.rs
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use procfs::process::Process;
|
||||
use std::collections::HashSet;
|
||||
|
||||
fn main() {
|
||||
for mount in Process::myself().unwrap().mountinfo().unwrap() {
|
||||
let (a, b): (HashSet<_>, HashSet<_>) = mount
|
||||
.mount_options
|
||||
.into_iter()
|
||||
.chain(mount.super_options)
|
||||
.partition(|&(_, ref m)| m.is_none());
|
||||
|
||||
println!(
|
||||
"{} on {} type {} ({})",
|
||||
mount.mount_source.unwrap_or_else(|| "None".to_string()),
|
||||
mount.mount_point.display(),
|
||||
mount.fs_type,
|
||||
a.into_iter().map(|(k, _)| k).collect::<Vec<_>>().join(",")
|
||||
);
|
||||
|
||||
for (opt, val) in b {
|
||||
if let Some(val) = val {
|
||||
println!(" {} = {}", opt, val);
|
||||
} else {
|
||||
println!(" {}", opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue