Skip to content
Snippets Groups Projects
Commit 95fc462f authored by dario's avatar dario
Browse files

collect loaded sessions in vector

parent ff7def5b
No related branches found
No related tags found
No related merge requests found
...@@ -26,14 +26,15 @@ pub fn main() { ...@@ -26,14 +26,15 @@ pub fn main() {
// load Xsessions // load Xsessions
let sessions = vec![]; let mut sessions = vec![];
for p in glob::glob("/usr/share/xsessions/*.desktop").unwrap() { for p in glob::glob("/usr/share/xsessions/*.desktop").unwrap() {
// glob gives you all the files, and those that don't match as Err(_)… // glob gives you all the files, and those that don't match as Err(_)…
if let Ok(path) = p { if let Ok(path) = p {
let info = load_xsession_file(path.to_str().unwrap()); if let Ok(info) = load_xsession_file(path.to_str().unwrap()) {
println!("{:?}", info); //println!("{:?}", info);
sessions.push(info); sessions.push(info);
} }
}
} }
...@@ -56,6 +57,8 @@ pub fn main() { ...@@ -56,6 +57,8 @@ pub fn main() {
.unwrap(); .unwrap();
let event_iter = window.events().ups(60).max_fps(60); let event_iter = window.events().ups(60).max_fps(60);
let mut gl = GlGraphics::new(opengl); let mut gl = GlGraphics::new(opengl);
// end conrod examples // end conrod examples
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment