Skip to content

Commit 0fe399a

Browse files
committed
Use is_some_and for takes_two_entries.
1 parent ad2e075 commit 0fe399a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/transport/pci/bus.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ impl<C: ConfigurationAccess> PciRoot<C> {
202202
let mut bar_index = 0;
203203
while bar_index < 6 {
204204
let info = self.bar_info(device_function, bar_index)?;
205-
let takes_two_entries = if let Some(info) = &info {
206-
info.takes_two_entries()
205+
let bar_entries = if info.as_ref().is_some_and(BarInfo::takes_two_entries) {
206+
2
207207
} else {
208-
false
208+
1
209209
};
210210
bars[usize::from(bar_index)] = info;
211-
bar_index += if takes_two_entries { 2 } else { 1 };
211+
bar_index += bar_entries;
212212
}
213213
Ok(bars)
214214
}

0 commit comments

Comments
 (0)