power_abstraction_result_return
power_abstractions
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::On
fn get_is_switch_on(&mut self, switch_id: SwitchId) -> Result<bool, ()> {
I think Result<bool, Self::Error> can be returned here by writing self.get_switch_state(..)? == SwitchState::On
Result<bool, Self::Error>
self.get_switch_state(..)? == SwitchState::On
No dependencies set.
The note is not visible to the blocked user.
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