We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a0e92e commit 88b1e3aCopy full SHA for 88b1e3a
1 file changed
src/dmi.rs
@@ -36,7 +36,7 @@ pub struct DMI {
36
baseboard: Baseboard,
37
chassis: Chassis,
38
memory: Memory,
39
- battery: Battery,
+ battery: Option<Battery>,
40
pub focused_section: FocusedSection,
41
}
42
@@ -199,7 +199,7 @@ impl DMI {
199
baseboard: baseboard.unwrap(),
200
chassis: chassis.unwrap(),
201
memory: memory.unwrap(),
202
- battery: battery.unwrap(),
+ battery,
203
focused_section: FocusedSection::Firmware,
204
})
205
@@ -344,7 +344,9 @@ impl DMI {
344
self.memory.render(frame, section_block);
345
346
FocusedSection::Battery => {
347
- self.battery.render(frame, section_block);
+ if let Some(battery) = &self.battery {
348
+ battery.render(frame, section_block);
349
+ }
350
351
352
0 commit comments