begin documenting some functions and align error messages

This commit is contained in:
2025-10-14 12:47:33 -07:00
parent 7a0c32c191
commit e90b45f58d
15 changed files with 148 additions and 101 deletions

View File

@@ -25,9 +25,9 @@ pub fn default_splash_time() -> u32 {
fn setup_graphics() -> Result<ScopedProtocol<GraphicsOutput>> {
let gop_handle = uefi::boot::get_handle_for_protocol::<GraphicsOutput>()
.context("failed to get graphics output")?;
.context("unable to get graphics output")?;
uefi::boot::open_protocol_exclusive::<GraphicsOutput>(gop_handle)
.context("failed to open graphics output")
.context("unable to open graphics output")
}
fn fit_to_frame(image: &DynamicImage, frame: Rect) -> Rect {
@@ -99,7 +99,7 @@ pub fn splash(context: Rc<SproutContext>, configuration: &SplashConfiguration) -
let image = read_file_contents(context.root().loaded_image_path()?, &image)?;
let image = ImageReader::with_format(Cursor::new(image), ImageFormat::Png)
.decode()
.context("failed to decode splash image")?;
.context("unable to decode splash image")?;
draw(image)?;
std::thread::sleep(Duration::from_secs(configuration.time as u64));
Ok(())