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
1 change: 1 addition & 0 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ xshell = { workspace = true, optional = true }
anstyle = "1.0.6"
comfy-table = "7.1.1"
liboverdrop = "0.1.0"
unicode-width = "0.2"
libsystemd = "0.7"
linkme = "0.3"
nom = "8.0.0"
Expand Down
7 changes: 6 additions & 1 deletion crates/lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use ostree_ext::oci_spec;
use ostree_ext::oci_spec::image::Digest;
use ostree_ext::oci_spec::image::ImageConfiguration;
use ostree_ext::sysroot::SysrootLock;
use unicode_width::UnicodeWidthStr;

use ostree_ext::ostree;

Expand Down Expand Up @@ -832,7 +833,11 @@ fn container_inspect_print_human(
rows.push(("Kargs", kargs));

// Find the max label width for right-alignment
let max_label_len = rows.iter().map(|(label, _)| label.len()).max().unwrap_or(0);
let max_label_len = rows
.iter()
.map(|(label, _)| label.width())
.max()
.unwrap_or(0);

for (label, value) in rows {
write_row_name(&mut out, label, max_label_len)?;
Expand Down
4 changes: 2 additions & 2 deletions crates/tests-integration/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ pub(crate) fn test_compute_composefs_digest() -> Result<()> {

// Verify it's a valid hex string of expected length (SHA-512 = 128 hex chars)
assert_eq!(
digest.len(),
digest.as_bytes().len(),
128,
"Expected 512-bit hex digest, got length {}",
digest.len()
digest.as_bytes().len()
);
assert!(
digest.chars().all(|c| c.is_ascii_hexdigit()),
Expand Down