Don't use `map` to return values

This commit is contained in:
Zhang Junyang 2025-08-12 17:35:59 +08:00 committed by Tate, Hongliang Tian
parent e725bf4ab8
commit d0b98130cf
1 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ impl VmSpace {
guard: &'a G,
va: &Range<Vaddr>,
) -> Result<Cursor<'a>> {
Ok(self.pt.cursor(guard, va).map(Cursor)?)
Ok(Cursor(self.pt.cursor(guard, va)?))
}
/// Gets an mutable cursor in the virtual address range.
@ -108,10 +108,10 @@ impl VmSpace {
guard: &'a G,
va: &Range<Vaddr>,
) -> Result<CursorMut<'a>> {
Ok(self.pt.cursor_mut(guard, va).map(|pt_cursor| CursorMut {
pt_cursor,
Ok(CursorMut {
pt_cursor: self.pt.cursor_mut(guard, va)?,
flusher: TlbFlusher::new(&self.cpus, disable_preempt()),
})?)
})
}
/// Activates the page table on the current CPU.