From 2c71e092f69f5cd3c31ad8a84aa4168118579898 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Oct 2017 21:40:25 +0200 Subject: [PATCH] refactor: Compatibility with Rust 1.20 for_each was stabilised in 1.21, but is not yet available in all distributions. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 634d98f90..7a80b9708 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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) {