Skip to content

Commit 51d0d59

Browse files
committed
Use Option::Map
Fixes #243 Signed-off-by: Wayne Campbell <[email protected]>
1 parent 81fea68 commit 51d0d59

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/android/process.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,8 @@ impl ProcessInner {
186186
strong: bool,
187187
thread: Option<&Thread>,
188188
) -> KernelResult<Option<NodeRef>> {
189-
Ok(match self.get_existing_node(ptr, cookie)? {
190-
None => None,
191-
Some(node) => Some(self.new_node_ref(node, strong, thread)),
192-
})
189+
self.get_existing_node(ptr, cookie)?
190+
.map(|node| self.new_node_ref(node, strong, thread))
193191
}
194192

195193
fn register_thread(&mut self) -> bool {

0 commit comments

Comments
 (0)