audio: Fix the unreachable pattern warning with audio_cras

Builds with audio_cras feature gets the following warning

warning: unreachable pattern
   --> src/crosvm/sys/unix/device_helpers.rs:443:9
    |
443 |         _ => unreachable!(),
    |         ^
    |
    = note: `#[warn(unreachable_patterns)]` on by default

This is because the enum is fully matched when audio_cras is enabled.
Make the unreachable conditional based on the audio_cras feature.

TEST=None
BUG=None

Change-Id: I68f9d7e4571e043ba81ceef62ced075415398802
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3911098
Commit-Queue: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Vineeth Pillai 2022-09-21 18:43:59 +00:00 committed by crosvm LUCI
parent ea55d0fecd
commit ea67d8ba10

View file

@ -439,6 +439,7 @@ pub fn create_virtio_snd_device(
Backend::NULL => "snd_null_device",
#[cfg(feature = "audio_cras")]
Backend::Sys(virtio::snd::sys::StreamSourceBackend::CRAS) => "snd_cras_device",
#[cfg(not(feature = "audio_cras"))]
_ => unreachable!(),
};