Skip to content

Commit

Permalink
Remove a GenericResult
Browse files Browse the repository at this point in the history
  • Loading branch information
CaspianA1 committed Feb 6, 2025
1 parent 35606f1 commit 726ee5e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/dashboard_defs/spinitron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn make_spinitron_windows(
if model_name == SpinitronModelName::Spin && !is_text_window {
let spin_texture_window_size = window_size_pixels.0.min(window_size_pixels.1);
let size_2d = (spin_texture_window_size, spin_texture_window_size);
inner_shared_state.spinitron_state.update(size_2d, &mut inner_shared_state.error_state)?;
inner_shared_state.spinitron_state.update(size_2d, &mut inner_shared_state.error_state);
}

//////////
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard_defs/streaming_server_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Updatable for ServerStatusChecker {
fn server_status_updater_fn(params: WindowUpdaterParams) -> MaybeError {
let inner_shared_state = params.shared_window_state.get_mut::<SharedWindowState>();
let individual_window_state = params.window.get_state_mut::<ContinuallyUpdated<ServerStatusChecker>>();
individual_window_state.update(&(), &mut inner_shared_state.error_state)?;
individual_window_state.update(&(), &mut inner_shared_state.error_state);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/dashboard_defs/twilio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl TwilioState {
pixel_area: (u32, u32), font_info: &FontInfo,
text_color: ColorSDL) -> GenericResult<bool> {

let continual_updater_succeeded = self.continually_updated.update(&(), error_state)?;
let continual_updater_succeeded = self.continually_updated.update(&(), error_state);
let curr_continual_data = self.continually_updated.get_data();

let local = &mut self.id_to_texture_map;
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard_defs/weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Updatable for WeatherApiState {
fn weather_api_updater_fn(params: WindowUpdaterParams) -> MaybeError {
let inner_shared_state = params.shared_window_state.get_mut::<SharedWindowState>();
let individual_window_state = params.window.get_state_mut::<WeatherState>();
individual_window_state.continually_updated.update(&(), &mut inner_shared_state.error_state)?;
individual_window_state.continually_updated.update(&(), &mut inner_shared_state.error_state);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/spinitron/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl SpinitronState {
TextureCreationInfo::RawBytes(Cow::Borrowed(bytes))
}

pub fn update(&mut self, spin_texture_size: WindowSize, error_state: &mut ErrorState) -> GenericResult<bool> {
pub fn update(&mut self, spin_texture_size: WindowSize, error_state: &mut ErrorState) -> bool {
self.continually_updated.update(&spin_texture_size, error_state)
}
}
6 changes: 3 additions & 3 deletions src/utility_types/continually_updated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<T: Updatable + 'static> ContinuallyUpdated<T> {
}

// This returns false if a task failed to complete its operation on its current iteration.
pub fn update(&mut self, param: &T::Param, error_state: &mut ErrorState) -> GenericResult<bool> {
pub fn update(&mut self, param: &T::Param, error_state: &mut ErrorState) -> bool {
let mut error: Option<String> = None;

match self.data_receiver.try_recv() {
Expand All @@ -130,13 +130,13 @@ impl<T: Updatable + 'static> ContinuallyUpdated<T> {
if let Some(err) = error {
error_state.report(self.name, &err);
self.run_new_update_iteration(param);
return Ok(false);
return false;
}
else {
error_state.unreport(self.name);
}

Ok(true)
true
}

pub const fn get_data(&self) -> &T {
Expand Down

0 comments on commit 726ee5e

Please sign in to comment.