refactor: Compatibility with Rust 1.20

for_each was stabilised in 1.21, but is not yet available in all
distributions.
This commit is contained in:
Vincent Ambo 2017-10-20 21:40:25 +02:00
parent d742c6526b
commit 2c71e092f6

View file

@ -11,7 +11,7 @@ fn run_ls() {
let mqueues = read_dir("/dev/mqueue")
.expect("Could not read message queues");
mqueues.for_each(|queue| {
for queue in mqueues {
let path = queue.unwrap().path();
let status = {
let mut file = File::open(&path)
@ -25,7 +25,7 @@ fn run_ls() {
let queue_name = path.components().last().unwrap().as_os_str();
println!("{:?}: {}", queue_name, status)
});
};
}
fn run_inspect(queue_name: &str) {