Skip to content

fix: non-exhaustive patterns on store - #424

Open
7flying wants to merge 1 commit into
fdo-rs:mainfrom
7flying:fix-store
Open

fix: non-exhaustive patterns on store#424
7flying wants to merge 1 commit into
fdo-rs:mainfrom
7flying:fix-store

Conversation

@7flying

@7flying 7flying commented Feb 17, 2023

Copy link
Copy Markdown
Contributor

Fixes a warning on the store

Signed-off-by: Irene Diez <idiez@redhat.com>
@puiterwijk

Copy link
Copy Markdown
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

7flying commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

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