Skip to content

Commit 30b4c30

Browse files
committed
Use unreachable!() on unreachable code
1 parent ce8e98f commit 30b4c30

File tree

1 file changed

+4
-4
lines changed
  • battery-service/src/fuel_gauge

1 file changed

+4
-4
lines changed

battery-service/src/fuel_gauge/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<F: embedded_batteries_async::smart_battery::SmartBattery> FuelGauge<F> {
6262
if let BatteryMsgs::Acpi(crate::BatteryMessage::State(state)) = res.unwrap() {
6363
state
6464
} else {
65-
1234
65+
unreachable!();
6666
}
6767
)
6868
}
@@ -82,7 +82,7 @@ impl<F: embedded_batteries_async::smart_battery::SmartBattery> FuelGauge<F> {
8282
if let BatteryMsgs::Acpi(crate::BatteryMessage::PresentRate(current)) = res.unwrap() {
8383
current
8484
} else {
85-
1234
85+
unreachable!();
8686
}
8787
)
8888
}
@@ -107,7 +107,7 @@ impl<F: embedded_batteries_async::smart_battery::SmartBattery> FuelGauge<F> {
107107
if let BatteryMsgs::Acpi(crate::BatteryMessage::RemainCap(cap)) = res.unwrap() {
108108
cap
109109
} else {
110-
1234
110+
unreachable!();
111111
}
112112
)
113113
}
@@ -127,7 +127,7 @@ impl<F: embedded_batteries_async::smart_battery::SmartBattery> FuelGauge<F> {
127127
if let BatteryMsgs::Acpi(crate::BatteryMessage::PresentVolt(v)) = res.unwrap() {
128128
v
129129
} else {
130-
1234
130+
unreachable!();
131131
}
132132
)
133133
}

0 commit comments

Comments
 (0)