Skip to content

Commit 6e28ea3

Browse files
authored
Merge pull request #45 from containers/minor
Two followups to previous PR
2 parents c5a462b + 493ceb9 commit 6e28ea3

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ serde = { features = ["derive"], version = "1.0.125" }
1818
serde_json = "1.0.64"
1919
tar = "0.4.38"
2020
thiserror = "2"
21-
oci-spec = "0.8.0"
21+
# See https://github.com/youki-dev/oci-spec-rs/pull/288
22+
oci-spec = "0.8.2"
2223
zstd = { version = "0.13.2", optional = true }
2324
canon-json = "0.2.0"
2425

examples/ocidir-import-tar.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ fn import(oci_dir: &OciDir, name: &str, src: File) -> anyhow::Result<()> {
4242
.created_by(name.to_string())
4343
.build()
4444
.unwrap();
45-
match config.history_mut() {
46-
Some(v) => v.push(h),
47-
None => {
48-
config.set_history(Some(vec![h]));
49-
}
50-
}
45+
config.history_mut().get_or_insert_default().push(h);
5146

5247
println!(
5348
"Created image with manifest: {}",

src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,7 @@ impl OciDir {
429429
} else {
430430
oci_image::HistoryBuilder::default().build().unwrap()
431431
};
432-
match config.history_mut() {
433-
Some(h) => h.push(history),
434-
None => {
435-
config.set_history(Some(vec![history]));
436-
}
437-
}
432+
config.history_mut().get_or_insert_default().push(history);
438433
}
439434

440435
/// Add a layer to the top of the image stack with desired history entry.

0 commit comments

Comments
 (0)