For the Last snippet in post 3 it is mentioned that it was "required jump through some hoops to satisfy the borrow checker". However, when using a if let statement to pattern match the FrameBuffer out of the option and then getting the info and buffer like so:
fn kernel_main(boot_info: &'static mut bootloader_api::BootInfo) -> ! {
if let Some(frame) = boot_info.framebuffer.as_mut(){
// it is important to get the info first, or else the borrow checker will complain
let info = frame.info();
let buffer = frame.buffer_mut();
init_logger(buffer, info);
}
loop{}
}
the borrow checker doesnt complain whatsoever.
Would it be possible to update your code accordingly?
For the Last snippet in post 3 it is mentioned that it was "required jump through some hoops to satisfy the borrow checker". However, when using a
if let
statement to pattern match theFrameBuffer
out of the option and then getting the info and buffer like so:the borrow checker doesnt complain whatsoever. Would it be possible to update your code accordingly?