Skip to content

Commit 4eb3e7e

Browse files
committed
deobjectification.
1 parent 499c669 commit 4eb3e7e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tock/kernel/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2577,6 +2577,13 @@ impl<T> MapCell<T> {
25772577
loop { }
25782578
}
25792579
}
2580+
2581+
fn mapcell_map<T, F, R>(closure: F) -> Option<R> where F: FnOnce(&mut T) -> R
2582+
{
2583+
closure(None::<&mut T>.unwrap());
2584+
loop { }
2585+
}
2586+
25802587
use crate::common::{Queue, RingBuffer};
25812588
use crate::mem::{AppSlice, Shared};
25822589
use crate::platform::mpu::{self, MPU};
@@ -2719,7 +2726,7 @@ pub struct Process<'a, C: 'static + Chip> {
27192726

27202727
impl<C: Chip> ProcessType for Process<'a, C> {
27212728
unsafe fn process_detail_fmt(&self, writer: &mut dyn Write) {
2722-
self.mpu_config.map(|config| {
2729+
mapcell_map(|config: &mut <<C as Chip>::MPU as MPU>::MpuConfig| {
27232730
let _ = writer.write_fmt(format_args!("{}", config));
27242731
});
27252732
}

0 commit comments

Comments
 (0)