added result return to get_switch_state #30
No reviewers
Labels
No Label
api
b-api
bug
concepts
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rust/sat-rs#30
Loading…
Reference in New Issue
Block a user
No description provided.
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
added result return to get_switch_stateto WIP: added result return to get_switch_stateWIP: added result return to get_switch_stateto added result return to get_switch_state@ -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 writingself.get_switch_state(..)? == SwitchState::On