Skip to content

Commit

Permalink
status: Minor code refactorings
Browse files Browse the repository at this point in the history
- Rename variable to `slot_name` as I think it's a bit clearer

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Sep 19, 2024
1 parent 21c7b3c commit 3f11c4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
}

fn human_readable_output(mut out: impl Write, host: &Host) -> Result<()> {
for (status_string, status) in [
for (slot_name, status) in [
("staged", &host.status.staged),
("booted", &host.status.booted),
("rollback", &host.status.rollback),
Expand All @@ -342,7 +342,7 @@ fn human_readable_output(mut out: impl Write, host: &Host) -> Result<()> {
// But for non-registry we include the transport
Cow::Owned(format!("{transport}:{imagename}"))
};
writeln!(out, "Current {status_string} image: {imageref}")?;
writeln!(out, "Current {slot_name} image: {imageref}")?;

let version = image
.version
Expand All @@ -358,10 +358,10 @@ fn human_readable_output(mut out: impl Write, host: &Host) -> Result<()> {
writeln!(out, " Image version: {version} ({timestamp})")?;
writeln!(out, " Image digest: {digest}")?;
} else {
writeln!(out, "Current {status_string} state is native ostree")?;
writeln!(out, "Current {slot_name} state is native ostree")?;
}
} else {
writeln!(out, "No {status_string} image present")?;
writeln!(out, "No {slot_name} image present")?;
}
}
Ok(())
Expand Down

0 comments on commit 3f11c4f

Please sign in to comment.