dragonball: Remove unnecessary unwrap

Given that we call `is_some` earlier, we don't then need to unwrap,
so refactor to avoid this

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman
2025-12-12 11:10:30 +00:00
parent 20192f819f
commit f4dd69a835

View File

@@ -352,8 +352,7 @@ impl Endpoint {
// base is not zero any more. So don't set queue base on reconnection.
// N.B. it's really TDD, we just found it works in this way. Any spec about this?
for queue_index in 0..queue_num {
let base = if old.is_some() {
let conn = old.as_mut().unwrap();
let base = if let Some(conn) = &mut old {
match conn.get_vring_base(queue_index) {
Ok(val) => Some(val),
Err(_) => None,