fn ok(s: &mut Cursive, value: String, opt: String) {
        if !&value.is_empty() && !&opt.is_empty() {
            let set_path = settings::settings_dir();
            let list = Watchlist {
                title: value,
                option: opt,
            };
            settings::db_write_wl(&set_path, &list.title, &list.option)
                .expect("Failed to write into database");
            s.call_on_name(
                "watch-list",
                |wl: &mut TableView<Watchlist, WatchColumn>| {
                    wl.insert_item(list);
                },
            );
            s.pop_layer();
        } else {
            s.pop_layer();
        }
    }
// Function runs when the <Ok> button is pressed

Function runs when the  button is pressed
Function runs when the button is pressed
fn ok(s: &mut Cursive, value: String, opt: String) {
        if !&value.is_empty() && !&opt.is_empty() {
            let set_path = settings::settings_dir();
            let list = Watchlist {
                title: value,
                option: opt,
            };
            settings::db_write_wl(&set_path, &list.title, &list.option)
                .expect("Failed to write into database");
            s.call_on_name(
                "watch-list",
                |wl: &mut TableView<Watchlist, WatchColumn>| {
                    wl.insert_item(list);
                },
            );
            s.pop_layer();
        } else {
            s.pop_layer();
        }
    }
fn ok ( s : & mut Cursive , value : String , opt : String ) { if ! & value . is_empty ( ) && ! & opt . is_empty ( ) { let set_path = settings :: settings_dir ( ) ; let list = Watchlist { title : value , option : opt , } ; settings :: db_write_wl ( & set_path , & list . title , & list . option ) . expect ( " " ) ; s . call_on_name ( " " , | wl : & mut TableView < Watchlist , WatchColumn > | { wl . insert_item ( list ) ; } , ) ; s . pop_layer ( ) ; } else { s . pop_layer ( ) ; } }
Function runs when the <Ok> button is pressed
Function runs when the <Ok > button is pressed
s
&mut Cursive
value
String
opt
String
s
&mut Cursive
value
String
opt
String