From 95fc462ffab0226fbc5eef32f5e8322845b545f6 Mon Sep 17 00:00:00 2001 From: Johannes Schilling <dario@deaktualisierung.org> Date: Thu, 8 Oct 2015 16:58:06 +0200 Subject: [PATCH] collect loaded sessions in vector --- src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index a59aca4..259a899 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,13 +26,14 @@ pub fn main() { // load Xsessions - let sessions = vec![]; + let mut sessions = vec![]; for p in glob::glob("/usr/share/xsessions/*.desktop").unwrap() { // glob gives you all the files, and those that don't match as Err(_)… if let Ok(path) = p { - let info = load_xsession_file(path.to_str().unwrap()); - println!("{:?}", info); - sessions.push(info); + if let Ok(info) = load_xsession_file(path.to_str().unwrap()) { + //println!("{:?}", info); + sessions.push(info); + } } } @@ -56,6 +57,8 @@ pub fn main() { .unwrap(); let event_iter = window.events().ups(60).max_fps(60); let mut gl = GlGraphics::new(opengl); + + // end conrod examples -- GitLab