Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions crates/lib/src/parsers/grub_menuconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn take_until_balanced_allow_nested(

/// Parses a single menuentry with title and body commands.
#[allow(dead_code)]
fn parse_menuentry(input: &str) -> IResult<&str, MenuEntry> {
fn parse_menuentry(input: &str) -> IResult<&str, MenuEntry<'_>> {
let (input, _) = tag("menuentry").parse(input)?;

// Require at least one space after "menuentry"
Expand Down Expand Up @@ -198,7 +198,7 @@ fn skip_to_menuentry(input: &str) -> IResult<&str, ()> {

/// Parses all menuentries from a GRUB configuration file.
#[allow(dead_code)]
fn parse_all(input: &str) -> IResult<&str, Vec<MenuEntry>> {
fn parse_all(input: &str) -> IResult<&str, Vec<MenuEntry<'_>>> {
let mut remaining = input;
let mut entries = Vec::new();

Expand Down Expand Up @@ -230,7 +230,7 @@ fn parse_all(input: &str) -> IResult<&str, Vec<MenuEntry>> {

/// Main entry point for parsing GRUB menuentry files.
#[allow(dead_code)]
pub(crate) fn parse_grub_menuentry_file(contents: &str) -> anyhow::Result<Vec<MenuEntry>> {
pub(crate) fn parse_grub_menuentry_file(contents: &str) -> anyhow::Result<Vec<MenuEntry<'_>>> {
let (_, entries) = parse_all(&contents)
.map_err(|e| anyhow::anyhow!("Failed to parse GRUB menuentries: {e}"))?;
// Validate that entries have reasonable structure
Expand Down
2 changes: 1 addition & 1 deletion crates/lib/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub(crate) fn origin_has_rpmostree_stuff(kf: &glib::KeyFile) -> bool {

// Access the file descriptor for a sysroot
#[allow(unsafe_code)]
pub(crate) fn sysroot_fd(sysroot: &ostree::Sysroot) -> BorrowedFd {
pub(crate) fn sysroot_fd(sysroot: &ostree::Sysroot) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw(sysroot.fd()) }
}

Expand Down
2 changes: 1 addition & 1 deletion crates/ostree-ext/src/container/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct DeployOpts<'a> {
// Access the file descriptor for a sysroot
#[allow(unsafe_code)]
#[cfg(feature = "bootc")]
pub(crate) fn sysroot_fd(sysroot: &ostree::Sysroot) -> BorrowedFd {
pub(crate) fn sysroot_fd(sysroot: &ostree::Sysroot) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw(sysroot.fd()) }
}

Expand Down
2 changes: 1 addition & 1 deletion crates/ostree-ext/src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ fn ensure_parent_dirs(
.map_err(Into::into)
}

fn relative_path_components(p: &Utf8Path) -> impl Iterator<Item = Utf8Component> {
fn relative_path_components(p: &Utf8Path) -> impl Iterator<Item = Utf8Component<'_>> {
p.components()
.filter(|p| matches!(p, Utf8Component::Normal(_)))
}
Expand Down
4 changes: 2 additions & 2 deletions crates/ostree-ext/src/tar/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ fn map_path_inner<'p>(
}

/// Convert /usr/etc back to /etc
fn map_path(p: &Utf8Path) -> std::borrow::Cow<Utf8Path> {
fn map_path(p: &Utf8Path) -> std::borrow::Cow<'_, Utf8Path> {
map_path_inner(p, "./usr/etc", "./etc")
}

/// Convert etc to usr/etc
/// Note: no leading '/' or './'
fn unmap_path(p: &Utf8Path) -> std::borrow::Cow<Utf8Path> {
fn unmap_path(p: &Utf8Path) -> std::borrow::Cow<'_, Utf8Path> {
map_path_inner(p, "etc", "usr/etc")
}

Expand Down
2 changes: 1 addition & 1 deletion crates/ostree-ext/src/tar/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub(crate) struct TarImportConfig {
}

// If a path starts with /etc or ./etc or etc, remap it to be usr/etc.
fn remap_etc_path(path: &Utf8Path) -> Cow<Utf8Path> {
fn remap_etc_path(path: &Utf8Path) -> Cow<'_, Utf8Path> {
let mut components = path.components();
let Some(prefix) = components.next() else {
return Cow::Borrowed(path);
Expand Down