Skip to content

Commit

Permalink
refactor: use Some as lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenautumns committed Nov 5, 2024
1 parent 563423c commit 3717ca4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where

// Serialize the received data into T
bincode::deserialize(&buffer[0..len])
.map(|r| Some(r))
.map(Some)
.typ(SystemError::Panic)
}

Expand Down
2 changes: 1 addition & 1 deletion hypervisor/src/hypervisor/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<'a> PartitionTimeframeScheduler<'a> {
/// `Ok(None)`. In case of `Ok(_)` the contained value is returned as
/// `Ok(Some(_))`.
fn handle_partition_result<T>(&mut self, res: TypedResult<T>) -> LeveledResult<Option<T>> {
res.map(|t| Some(t))
res.map(Some)
.or_else(|err| self.partition.handle_error(err).map(|_| None))
}
}

0 comments on commit 3717ca4

Please sign in to comment.