From 3eb41e3261df5c02b6abdb4d641f524a2d3b3f6f Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 20 Dec 2025 23:08:38 -0800 Subject: [PATCH] chore(docs): fix all rustdoc warnings --- Cargo.toml | 2 +- crates/boot/src/autoconfigure/linux.rs | 4 ++-- crates/boot/src/generators/bls.rs | 2 +- crates/boot/src/phases.rs | 2 +- crates/boot/src/utils/vercmp.rs | 2 +- crates/build/src/sbat.template.rs | 2 +- crates/config/src/actions/chainload.rs | 2 +- crates/eficore/src/lib.rs | 7 +++++-- crates/eficore/src/media_loader.rs | 3 +-- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 39c7127..1425049 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ version = "1.3.0" default-features = false [workspace.dependencies.toml] -version = "0.9.10+spec-1.1.0" +version = "0.9.10" default-features = false features = ["serde", "parse"] diff --git a/crates/boot/src/autoconfigure/linux.rs b/crates/boot/src/autoconfigure/linux.rs index e7f3bc9..1cb4ddc 100644 --- a/crates/boot/src/autoconfigure/linux.rs +++ b/crates/boot/src/autoconfigure/linux.rs @@ -37,9 +37,9 @@ const INITRAMFS_PREFIXES: &[&str] = &["initramfs", "initrd", "initrd.img"]; /// and then uses that code improperly by asserting that the pointer is non-null. /// To give a good user experience, we place a placeholder value here to ensure it's non-empty. /// For stubble, this code ensures the command line pointer becomes null: -/// https://github.com/ubuntu/stubble/blob/e56643979addfb98982266018e08921c07424a0c/stub.c#L61-L64 +/// /// Then this code asserts on it, stopping the boot process: -/// https://github.com/ubuntu/stubble/blob/e56643979addfb98982266018e08921c07424a0c/stub.c#L27 +/// const DEFAULT_LINUX_OPTIONS: &str = "placeholder"; /// Pair of kernel and initramfs. diff --git a/crates/boot/src/generators/bls.rs b/crates/boot/src/generators/bls.rs index ebdf088..659d186 100644 --- a/crates/boot/src/generators/bls.rs +++ b/crates/boot/src/generators/bls.rs @@ -26,7 +26,7 @@ fn quirk_initrd_remove_tuned(input: String) -> String { } /// Sorts two entries according to the BLS sort system. -/// Reference: https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting +/// Reference: fn sort_entries(a: &(BlsEntry, BootableEntry), b: &(BlsEntry, BootableEntry)) -> Ordering { // Grab the components of both entries. let (a_bls, a_boot) = a; diff --git a/crates/boot/src/phases.rs b/crates/boot/src/phases.rs index c047dfc..9d9eece 100644 --- a/crates/boot/src/phases.rs +++ b/crates/boot/src/phases.rs @@ -6,7 +6,7 @@ use anyhow::{Context, Result}; use edera_sprout_config::phases::PhaseConfiguration; /// Executes the specified [phase] of the boot process. -/// The value [phase] should be a reference of a specific phase in the [PhasesConfiguration]. +/// The value [phase] should be a reference of a specific phase in the `PhasesConfiguration`. /// Any error from the actions is propagated into the [Result] and will interrupt further /// execution of phase actions. pub fn phase(context: Rc, phase: &[PhaseConfiguration]) -> Result<()> { diff --git a/crates/boot/src/utils/vercmp.rs b/crates/boot/src/utils/vercmp.rs index 61eb39a..d83490b 100644 --- a/crates/boot/src/utils/vercmp.rs +++ b/crates/boot/src/utils/vercmp.rs @@ -33,7 +33,7 @@ pub fn compare_versions_optional(a: Option<&str>, b: Option<&str>) -> Ordering { } /// Compares two strings using the BLS version comparison specification. -/// See: https://uapi-group.org/specifications/specs/version_format_specification/ +/// See: pub fn compare_versions(a: &str, b: &str) -> Ordering { // Acquire a peekable iterator for each string. let mut a_chars = a.chars().peekable(); diff --git a/crates/build/src/sbat.template.rs b/crates/build/src/sbat.template.rs index f20430a..91ff875 100644 --- a/crates/build/src/sbat.template.rs +++ b/crates/build/src/sbat.template.rs @@ -1,5 +1,5 @@ /// Define the SBAT attestation by including the sbat.csv file. -/// See this document for more details: https://github.com/rhboot/shim/blob/main/SBAT.md +/// See this document for more details: /// NOTE: This data must be aligned by 512 bytes. #[used] #[unsafe(link_section = ".sbat")] diff --git a/crates/config/src/actions/chainload.rs b/crates/config/src/actions/chainload.rs index a06a8fd..55c7f00 100644 --- a/crates/config/src/actions/chainload.rs +++ b/crates/config/src/actions/chainload.rs @@ -13,7 +13,7 @@ pub struct ChainloadConfiguration { #[serde(default)] pub options: Vec, /// An optional path to a Linux initrd. - /// This uses the [LINUX_EFI_INITRD_MEDIA_GUID] mechanism to load the initrd into the EFI stack. + /// This uses the `LINUX_EFI_INITRD_MEDIA_GUID` mechanism to load the initrd into the EFI stack. /// For Linux, you can also use initrd=\path\to\initrd as an option, but this option is /// generally better and safer as it can support additional load options in the future. #[serde(default, rename = "linux-initrd")] diff --git a/crates/eficore/src/lib.rs b/crates/eficore/src/lib.rs index 7449d82..3819196 100644 --- a/crates/eficore/src/lib.rs +++ b/crates/eficore/src/lib.rs @@ -1,5 +1,8 @@ -//! Sprout EFI Core. -//! This crate provides tools for working with the EFI environment. +//! Sprout EFI core. +//! This crate provides core EFI functionality for Sprout. + +// For some reason this triggers, and I can't figure out why. +#![allow(rustdoc::bare_urls)] #![no_std] extern crate alloc; diff --git a/crates/eficore/src/media_loader.rs b/crates/eficore/src/media_loader.rs index f0bd793..1976d97 100644 --- a/crates/eficore/src/media_loader.rs +++ b/crates/eficore/src/media_loader.rs @@ -34,8 +34,7 @@ struct MediaLoaderProtocol { } /// Represents a media loader which has been registered in the UEFI stack. -/// You MUST call [MediaLoaderHandle::unregister] when ready to unregister. -/// [Drop] is not implemented for this type. +/// Calling `drop` on this handle will unregister the media loader. pub struct MediaLoaderHandle { /// The handle of the media loader in the UEFI stack. handle: Handle,