fix(docs): cleanup rustdoc warnings

This commit is contained in:
2025-10-24 15:54:58 -07:00
parent e096f8e236
commit d3f9e876fb
3 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ pub struct DriverDeclaration {
pub path: String, pub path: String,
} }
/// Loads the driver specified by the [driver] declaration. /// Loads the driver specified by the `driver` declaration.
fn load_driver(context: Rc<SproutContext>, driver: &DriverDeclaration) -> Result<()> { fn load_driver(context: Rc<SproutContext>, driver: &DriverDeclaration) -> Result<()> {
// Acquire the handle and device path of the loaded image. // Acquire the handle and device path of the loaded image.
let sprout_image = uefi::boot::image_handle(); let sprout_image = uefi::boot::image_handle();

View File

@@ -12,7 +12,7 @@ pub mod framebuffer;
/// Support code for the media loader protocol. /// Support code for the media loader protocol.
pub mod media_loader; pub mod media_loader;
/// Parses the input [path] as a [DevicePath]. /// Parses the input `path` as a [DevicePath].
/// Uses the [DevicePathFromText] protocol exclusively, and will fail if it cannot acquire the protocol. /// Uses the [DevicePathFromText] protocol exclusively, and will fail if it cannot acquire the protocol.
pub fn text_to_device_path(path: &str) -> Result<PoolDevicePath> { pub fn text_to_device_path(path: &str) -> Result<PoolDevicePath> {
let path = CString16::try_from(path).context("unable to convert path to CString16")?; let path = CString16::try_from(path).context("unable to convert path to CString16")?;
@@ -27,7 +27,7 @@ pub fn text_to_device_path(path: &str) -> Result<PoolDevicePath> {
.context("unable to convert text to device path") .context("unable to convert text to device path")
} }
/// Grabs the root part of the [path]. /// Grabs the root part of the `path`.
/// For example, given "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\EFI\BOOT\BOOTX64.efi" /// For example, given "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\EFI\BOOT\BOOTX64.efi"
/// it will give "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)" /// it will give "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)"
pub fn device_path_root(path: &DevicePath) -> Result<String> { pub fn device_path_root(path: &DevicePath) -> Result<String> {
@@ -52,7 +52,7 @@ pub fn device_path_root(path: &DevicePath) -> Result<String> {
Ok(path) Ok(path)
} }
/// Grabs the part of the [path] after the root. /// Grabs the part of the `path` after the root.
/// For example, given "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\EFI\BOOT\BOOTX64.efi" /// For example, given "PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\EFI\BOOT\BOOTX64.efi"
/// it will give "\EFI\BOOT\BOOTX64.efi" /// it will give "\EFI\BOOT\BOOTX64.efi"
pub fn device_path_subpath(path: &DevicePath) -> Result<String> { pub fn device_path_subpath(path: &DevicePath) -> Result<String> {
@@ -92,8 +92,8 @@ pub struct ResolvedPath {
pub filesystem_handle: Handle, pub filesystem_handle: Handle,
} }
/// Resolve a path specified by [input] to its various components. /// Resolve a path specified by `input` to its various components.
/// Uses [default_root_path] as the base root if one is not specified in the path. /// Uses `default_root_path` as the base root if one is not specified in the path.
/// Returns [ResolvedPath] which contains the resolved components. /// Returns [ResolvedPath] which contains the resolved components.
pub fn resolve_path(default_root_path: &DevicePath, input: &str) -> Result<ResolvedPath> { pub fn resolve_path(default_root_path: &DevicePath, input: &str) -> Result<ResolvedPath> {
let mut path = text_to_device_path(input).context("unable to convert text to path")?; let mut path = text_to_device_path(input).context("unable to convert text to path")?;
@@ -137,9 +137,9 @@ pub fn resolve_path(default_root_path: &DevicePath, input: &str) -> Result<Resol
}) })
} }
/// Read the contents of a file at the location specified with the [input] path. /// Read the contents of a file at the location specified with the `input` path.
/// Internally, this uses [resolve_path] to resolve the path to its various components. /// Internally, this uses [resolve_path] to resolve the path to its various components.
/// [resolve_path] is passed the [default_root_path] which should specify a base root. /// [resolve_path] is passed the `default_root_path` which should specify a base root.
/// ///
/// This acquires exclusive protocol access to the [SimpleFileSystem] protocol of the resolved /// This acquires exclusive protocol access to the [SimpleFileSystem] protocol of the resolved
/// filesystem handle, so care must be taken to call this function outside a scope with /// filesystem handle, so care must be taken to call this function outside a scope with

View File

@@ -46,8 +46,8 @@ pub struct MediaLoaderHandle {
impl MediaLoaderHandle { impl MediaLoaderHandle {
/// The behavior of this function is derived from how Linux calls it. /// The behavior of this function is derived from how Linux calls it.
/// ///
/// Linux calls this function by first passing a NULL [buffer]. /// Linux calls this function by first passing a NULL `buffer`.
/// We must set the size of the buffer it should allocate in [buffer_size]. /// We must set the size of the buffer it should allocate in `buffer_size`.
/// The next call will pass a buffer of the right size, and we should copy /// The next call will pass a buffer of the right size, and we should copy
/// data into that buffer, checking whether it is safe to copy based on /// data into that buffer, checking whether it is safe to copy based on
/// the buffer size. /// the buffer size.
@@ -137,7 +137,7 @@ impl MediaLoaderHandle {
Ok(false) Ok(false)
} }
/// Registers the provided [data] with the UEFI stack as media loader. /// Registers the provided `data` with the UEFI stack as media loader.
/// This uses a special device path that other EFI programs will look at /// This uses a special device path that other EFI programs will look at
/// to load the data from. /// to load the data from.
pub fn register(guid: Guid, data: Box<[u8]>) -> Result<MediaLoaderHandle> { pub fn register(guid: Guid, data: Box<[u8]>) -> Result<MediaLoaderHandle> {