From 1cc31898c66bb3718a9ab999fd68813283219c00 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 3 Sep 2024 13:26:47 -0400 Subject: [PATCH] uefi: Add panic doc to uefi::helpers::init This function may panic if called more than once, because `log::set_logger` panics if called more than once. Document this panic. --- uefi/src/helpers/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uefi/src/helpers/mod.rs b/uefi/src/helpers/mod.rs index 8779092ce..d0a385891 100644 --- a/uefi/src/helpers/mod.rs +++ b/uefi/src/helpers/mod.rs @@ -55,6 +55,10 @@ pub fn system_table() -> SystemTable { /// **PLEASE NOTE** that these helpers are meant for the pre exit boot service /// epoch. Limited functionality might work after exiting them, such as logging /// to the debugcon device. +/// +/// # Panics +/// +/// This function may panic if called more than once. #[allow(clippy::missing_const_for_fn)] pub fn init() -> Result<()> { // Set up logging.