Skip to content

Commit 60857c7

Browse files
vmm: removed unnecessary lines from handlers
Signed-off-by: Andreea Florescu <[email protected]>
1 parent c58b66a commit 60857c7

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

vmm/src/lib.rs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,16 +1364,10 @@ impl Vmm {
13641364
}
13651365

13661366
fn handle_put_drive(&mut self, block_device_config: BlockDeviceConfig, sender: OutcomeSender) {
1367-
match self.insert_block_device(block_device_config) {
1368-
Ok(ret) => sender
1369-
.send(Box::new(ret))
1370-
.map_err(|_| ())
1371-
.expect("one-shot channel closed"),
1372-
Err(e) => sender
1373-
.send(Box::new(e))
1374-
.map_err(|_| ())
1375-
.expect("one-shot channel closed"),
1376-
}
1367+
sender
1368+
.send(Box::new(self.insert_block_device(block_device_config)))
1369+
.map_err(|_| ())
1370+
.expect("one-shot channel closed");
13771371
}
13781372

13791373
fn handle_patch_drive(
@@ -1382,16 +1376,10 @@ impl Vmm {
13821376
path_on_host: String,
13831377
sender: OutcomeSender,
13841378
) {
1385-
match self.set_block_device_path(drive_id, path_on_host) {
1386-
Ok(ret) => sender
1387-
.send(Box::new(ret))
1388-
.map_err(|_| ())
1389-
.expect("one-shot channel closed"),
1390-
Err(e) => sender
1391-
.send(Box::new(e))
1392-
.map_err(|_| ())
1393-
.expect("one-shot channel closed"),
1394-
}
1379+
sender
1380+
.send(Box::new(self.set_block_device_path(drive_id, path_on_host)))
1381+
.map_err(|_| ())
1382+
.expect("one-shot channel closed");
13951383
}
13961384

13971385
fn handle_put_logger(

0 commit comments

Comments
 (0)