Skip to content

Commit 06847c3

Browse files
committed
feat(boil): Use stable sorting for output
1 parent 43f28b0 commit 06847c3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

rust/boil/src/cmd/image.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::{
2-
collections::{BTreeMap, HashMap},
3-
io::IsTerminal,
4-
};
1+
use std::{collections::BTreeMap, io::IsTerminal};
52

63
use secrecy::{ExposeSecret, SecretString};
74
use serde::Serialize;
@@ -180,12 +177,12 @@ pub async fn calculate_size(arguments: ImageSizeArguments, config: Config) -> Re
180177

181178
#[derive(Serialize)]
182179
struct SizeResult {
183-
images: HashMap<String, u64>,
180+
images: BTreeMap<String, u64>,
184181
total: u64,
185182
}
186183

187184
let mut result = SizeResult {
188-
images: HashMap::new(),
185+
images: BTreeMap::new(),
189186
total: 0,
190187
};
191188

@@ -251,6 +248,7 @@ pub async fn calculate_size(arguments: ImageSizeArguments, config: Config) -> Re
251248
.map(|i| i.0.len())
252249
.max_by(|lhs, rhs| lhs.cmp(rhs))
253250
{
251+
// let sorted = result.images;
254252
for (image, size) in result.images {
255253
println!(
256254
"{image:max_width$} {size}",

0 commit comments

Comments
 (0)