Skip to content

Commit 79ed0be

Browse files
committed
boundimage: More struct definition to top
I think it's generally best to have type definitions come before the code that references them. Signed-off-by: Colin Walters <[email protected]>
1 parent 3357d2a commit 79ed0be

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/src/boundimage.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ use ostree_ext::sysroot::SysrootLock;
1818
/// symbolic links to `.container` or `.image` files.
1919
const BOUND_IMAGE_DIR: &str = "usr/lib/bootc-experimental/bound-images.d";
2020

21+
/// A subset of data parsed from a `.image` or `.container` file with
22+
/// the minimal information necessary to fetch the image.
23+
///
24+
/// In the future this may be extended to include e.g. certificates or
25+
/// other pull options.
26+
#[derive(PartialEq, Eq)]
27+
struct BoundImage {
28+
image: String,
29+
auth_file: Option<String>,
30+
}
31+
2132
/// Given a deployment, pull all container images it references.
2233
pub(crate) fn pull_bound_images(sysroot: &SysrootLock, deployment: &Deployment) -> Result<()> {
2334
let deployment_root = &crate::utils::deployment_fd(sysroot, deployment)?;
@@ -117,17 +128,6 @@ fn pull_images(_deployment_root: &Dir, bound_images: Vec<BoundImage>) -> Result<
117128
Ok(())
118129
}
119130

120-
/// A subset of data parsed from a `.image` or `.container` file with
121-
/// the minimal information necessary to fetch the image.
122-
///
123-
/// In the future this may be extended to include e.g. certificates or
124-
/// other pull options.
125-
#[derive(PartialEq, Eq)]
126-
struct BoundImage {
127-
image: String,
128-
auth_file: Option<String>,
129-
}
130-
131131
impl BoundImage {
132132
fn new(image: String, auth_file: Option<String>) -> Result<BoundImage> {
133133
let image = parse_spec_value(&image).context("Invalid image value")?;

0 commit comments

Comments
 (0)