Skip to content

Commit 9ef5eaf

Browse files
committed
style: Remove unnecessary explicit return statements
Use implicit return expressions instead of explicit `return` statements for the final expression in functions, following Rust conventions. Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Colin Walters <[email protected]>
1 parent 4dd26d3 commit 9ef5eaf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/lib/src/bootc_composefs/boot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub fn get_sysroot_parent_dev() -> Result<String> {
178178
anyhow::bail!("Could not find parent device for mountpoint /sysroot");
179179
};
180180

181-
return Ok(parent);
181+
Ok(parent)
182182
}
183183

184184
pub fn type1_entry_conf_file_name(sort_key: impl std::fmt::Display) -> String {
@@ -211,7 +211,7 @@ fn compute_boot_digest(
211211

212212
let digest: &[u8] = &hasher.finish().context("Finishing digest")?;
213213

214-
return Ok(hex::encode(digest));
214+
Ok(hex::encode(digest))
215215
}
216216

217217
/// Given the SHA256 sum of current VMlinuz + Initrd combo, find boot entry with the same SHA256Sum

crates/lib/src/bootc_composefs/status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub(crate) fn get_sorted_type1_boot_entries(
126126

127127
all_configs.sort_by(|a, b| if ascending { a.cmp(b) } else { b.cmp(a) });
128128

129-
return Ok(all_configs);
129+
Ok(all_configs)
130130
}
131131

132132
/// imgref = transport:image_name
@@ -244,7 +244,7 @@ async fn boot_entry_from_composefs_deployment(
244244
soft_reboot_capable: false,
245245
};
246246

247-
return Ok(e);
247+
Ok(e)
248248
}
249249

250250
#[context("Getting composefs deployment status")]

0 commit comments

Comments
 (0)