Skip to content

Conversation

@cgwalters
Copy link
Collaborator

Minor followup to the previous change; part of the idea of having the error types here is so we can also dig through the SkopeoSpawnError and precisely match against the std::io::ErrorKind::NotFound, and not rely on its stringified form. This is what we'd expect other callers to do.

This also avoids a double-match.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the followup! I'm (relatively) new to rust and definitely need to learn more how to write idiomatic tests, so seeing this is great! One small question inline.

Minor followup to the previous change; part of the idea of having
the error types here is so we can *also* dig through the `SkopeoSpawnError`
and precisely match against the `std::io::ErrorKind::NotFound`,
and not rely on its stringified form. This is what we'd expect
other callers to do.

This also avoids a double-match.

Signed-off-by: Colin Walters <[email protected]>
);
match ImageProxy::new_with_config(config).await {
Ok(_) => panic!("Expected an error"),
Err(ref e @ Error::SkopeoSpawnError(ref inner)) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting note: I needed to start using ref as we want to be able to look at both the inner and outer parts. This is pretty unusual IME.

@allisonkarlitskaya allisonkarlitskaya merged commit 918bfab into bootc-dev:main Jan 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants