added result return to get_switch_state #30
Reference in New Issue
Block a user
Delete Branch "power_abstraction_result_return"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
in case an invalid switch_id is given to the function, i.e. a switch_id that the powerswitcher does not implement
@@ -51,3 +51,2 @@fn get_is_switch_on(&mut self, switch_id: SwitchId) -> bool {self.get_switch_state(switch_id) == SwitchState::Onfn get_is_switch_on(&mut self, switch_id: SwitchId) -> Result<bool, ()> {I think
Result<bool, Self::Error>can be returned here by writingself.get_switch_state(..)? == SwitchState::On