mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 21:53:07 +00:00
Mute unreachable patterns/code warnings (#16012)
# Objective Make compiler output more helpful when running `cargo check -p bevy_mesh`. Currently it contains a lot of unreachable patterns/code warnings due to features disabled by default. ## Solution Mute the warnings. ## Testing CI
This commit is contained in:
parent
405fa3e8ea
commit
34c9a64779
1 changed files with 5 additions and 0 deletions
|
@ -166,6 +166,7 @@ impl ImageFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_mime_type(mime_type: &str) -> Option<Self> {
|
pub fn from_mime_type(mime_type: &str) -> Option<Self> {
|
||||||
|
#[allow(unreachable_code)]
|
||||||
Some(match mime_type.to_ascii_lowercase().as_str() {
|
Some(match mime_type.to_ascii_lowercase().as_str() {
|
||||||
// note: farbfeld does not have a MIME type
|
// note: farbfeld does not have a MIME type
|
||||||
"image/basis" | "image/x-basis" => feature_gate!("basis-universal", Basis),
|
"image/basis" | "image/x-basis" => feature_gate!("basis-universal", Basis),
|
||||||
|
@ -191,6 +192,7 @@ impl ImageFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_extension(extension: &str) -> Option<Self> {
|
pub fn from_extension(extension: &str) -> Option<Self> {
|
||||||
|
#[allow(unreachable_code)]
|
||||||
Some(match extension.to_ascii_lowercase().as_str() {
|
Some(match extension.to_ascii_lowercase().as_str() {
|
||||||
"basis" => feature_gate!("basis-universal", Basis),
|
"basis" => feature_gate!("basis-universal", Basis),
|
||||||
"bmp" => feature_gate!("bmp", Bmp),
|
"bmp" => feature_gate!("bmp", Bmp),
|
||||||
|
@ -213,6 +215,7 @@ impl ImageFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn as_image_crate_format(&self) -> Option<image::ImageFormat> {
|
pub fn as_image_crate_format(&self) -> Option<image::ImageFormat> {
|
||||||
|
#[allow(unreachable_code)]
|
||||||
Some(match self {
|
Some(match self {
|
||||||
#[cfg(feature = "bmp")]
|
#[cfg(feature = "bmp")]
|
||||||
ImageFormat::Bmp => image::ImageFormat::Bmp,
|
ImageFormat::Bmp => image::ImageFormat::Bmp,
|
||||||
|
@ -253,6 +256,7 @@ impl ImageFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_image_crate_format(format: image::ImageFormat) -> Option<ImageFormat> {
|
pub fn from_image_crate_format(format: image::ImageFormat) -> Option<ImageFormat> {
|
||||||
|
#[allow(unreachable_code)]
|
||||||
Some(match format {
|
Some(match format {
|
||||||
image::ImageFormat::Bmp => feature_gate!("bmp", Bmp),
|
image::ImageFormat::Bmp => feature_gate!("bmp", Bmp),
|
||||||
image::ImageFormat::Dds => feature_gate!("dds", Dds),
|
image::ImageFormat::Dds => feature_gate!("dds", Dds),
|
||||||
|
@ -895,6 +899,7 @@ impl Image {
|
||||||
ImageFormat::Ktx2 => {
|
ImageFormat::Ktx2 => {
|
||||||
ktx2_buffer_to_image(buffer, supported_compressed_formats, is_srgb)?
|
ktx2_buffer_to_image(buffer, supported_compressed_formats, is_srgb)?
|
||||||
}
|
}
|
||||||
|
#[allow(unreachable_patterns)]
|
||||||
_ => {
|
_ => {
|
||||||
let image_crate_format = format
|
let image_crate_format = format
|
||||||
.as_image_crate_format()
|
.as_image_crate_format()
|
||||||
|
|
Loading…
Reference in a new issue