You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
fnkernel_main(boot_info:&'static mut bootloader_api::BootInfo) -> ! {ifletSome(frame) = boot_info.framebuffer.as_mut(){// it is important to get the info first, or else the borrow checker will complainlet 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?
The text was updated successfully, but these errors were encountered:
a-usr
changed the title
Edition 3: Post 3: Proposal to change the contents of a code snippet
Edition 3: Post 3: Proposal to change the contents of a certain code snippet
Apr 22, 2024
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?
The text was updated successfully, but these errors were encountered: