Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: non-exhaustive patterns on store #424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

7flying
Copy link
Contributor

@7flying 7flying commented Feb 17, 2023

Fixes a warning on the store

@puiterwijk
Copy link
Contributor

I'd specifically not added that, to make sure that adding any new options would require adding the implementation, or it would be a compile-time error. This would make it a run-time error instead.
What warning are you seeing, maybe just allow that lint instead?

@7flying
Copy link
Contributor Author

7flying commented Jun 26, 2023

I'd specifically not added that, to make sure that adding any new options would require adding the implementation, or it would be a compile-time error. This would make it a run-time error instead. What warning are you seeing, maybe just allow that lint instead?

When we are trying to run a specific test of the integration-tests we usually run into this issue, which forces us to use github's CI:

cargo test -p integration-tests --test di_diun-tests

[.....]

   Compiling fdo-store v0.4.10 (/home/idiez/code/repos/fedora-iot/tests/fido-device-onboard-rs/store)
error[E0004]: non-exhaustive patterns: type `&StoreConfig` is non-empty
   --> store/src/lib.rs:234:15
    |
234 |         match self {
    |               ^^^^
    |
note: `StoreConfig` defined here
   --> store/src/lib.rs:220:10
    |
220 | pub enum StoreConfig {
    |          ^^^^^^^^^^^
    = note: the matched value is of type `&StoreConfig`
    = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
234 ~         match self {
235 +             _ => todo!(),
236 +         }
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `fdo-store` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

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.

2 participants