Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions crates/kernel_cmdline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ impl<'a> Cmdline<'a> {
/// Find the value of the kernel argument with the provided name, which must be present.
///
/// Otherwise the same as [`Self::value_of`].
#[cfg(test)]
pub fn require_value_of(&'a self, key: impl AsRef<[u8]>) -> Result<&'a [u8]> {
let key = key.as_ref();
self.value_of(key).ok_or_else(|| {
Expand All @@ -115,10 +114,10 @@ impl<'a> Cmdline<'a> {
})
}

/// Find the value of the kernel argument with the provided name, which must be present.
/// Find the UTF-8 value of the kernel argument with the provided
/// name, which must be present.
///
/// Otherwise the same as [`Self::value_of`].
#[cfg(test)]
/// Otherwise the same as [`Self::value_of_utf8`].
pub fn require_value_of_utf8(&'a self, key: &str) -> Result<&'a str> {
self.value_of_utf8(key)?
.ok_or_else(|| anyhow::anyhow!("Failed to find kernel argument '{key}'"))
Expand Down