diff --git a/src/rust/obs.rs b/src/rust/obs.rs index 15d0f58..5472cf6 100644 --- a/src/rust/obs.rs +++ b/src/rust/obs.rs @@ -18,21 +18,21 @@ impl Obs { Ok(()) } - pub fn get_list(self) -> Result, String> { + pub fn get_list(self) -> Result, Box> { let scenes = self.scenes.scenes.iter().map(|x| x.name).collect::>(); if scenes.len() > 0 { Ok(scenes) } else { - Err(format!("Scenes found: {}", scenes.len())) + Err(format!("Scenes found: {}", scenes.len()))? } } - pub fn set_scene(self, scene: String) -> Result<(), String> { + pub fn set_scene(self, scene: String) -> Result<(), Box> { if let Some(scene) = self.scenes.scenes.iter().filter(|x| x.name == scene).next() { self.client.scenes().set_current_program_scene(scene.name.as_str()); Ok(()) } else { - Err("Couldn't set the scene".to_string()) + Err("Couldn't set the scene".to_owned())? } } }