From aa9d82749ae45bc7c5310e1c2c901551aab65c83 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Thu, 21 Jun 2018 17:16:09 +0530 Subject: Resultify all functs --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index bc1188d..9a27b0e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ use cursive::traits::*; use cursive::views::{TextView, Dialog, EditView, SelectView}; pub mod content; +use content::*; fn main() { // Initial setup @@ -25,8 +26,12 @@ fn search(s: &mut Cursive){ fn go(s: &mut Cursive, search: &str) { s.pop_layer(); - let results = content::get_search_results(search); - s.add_layer(SelectView::new().with_all_str(results)); + let mut result; + match get_search_results(search) { + Ok(x) => result = x, + Err(e) => pop_error(s,handler(e)), + }; + let choose_result = SelectView::new().with_all_str(result); } s.add_layer(Dialog::around(EditView::new() -- cgit v1.2.3