Remove some unwraps.

This commit is contained in:
Jordan Petridis 2018-07-24 08:04:31 +03:00
parent 3e8a8a6b85
commit cc9fc80328
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
2 changed files with 9 additions and 4 deletions

View File

@ -278,7 +278,10 @@ impl App {
let notif = InAppNotification::new(&err, callback, || {}, UndoState::Hidden);
notif.show(&self.overlay);
}
Action::InitEpisode(rowid) => self.player.initialize_episode(rowid).unwrap(),
Action::InitEpisode(rowid) => {
let res = self.player.initialize_episode(rowid);
debug_assert!(res.is_ok());
}
Action::InitShowMenu(s) => {
let menu = s.borrow();
self.headerbar.set_secondary_menu(&menu.container);

View File

@ -70,9 +70,11 @@ impl Prefs {
self.cleanup_type.set_active(cleanup_pos);
self.cleanup_type
.connect_changed(clone!(settings, store => move |combo| {
let value = store.get_value(&combo.get_active_iter().unwrap(), 0);
let value: &str = value.get().unwrap();
settings.set_string("cleanup-age-period", &value.to_lowercase());
if let Some(ref treeiter) = combo.get_active_iter() {
if let Some(s) = store.get_value(treeiter, 0).get::<&str>() {
settings.set_string("cleanup-age-period", &s.to_lowercase());
}
};
}));
}