Skip to content

Commit

Permalink
Fix log_feature_error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopap committed Oct 27, 2023
1 parent a6d6baf commit ff1470f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/bevy_core_pipeline/src/tonemapping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,16 @@ impl Tonemapping {
}
}
#[cfg(feature = "tonemapping_luts")]
pub const fn log_feature_error(self) {}
pub fn log_feature_error(self) {}

#[cfg(not(feature = "tonemapping_luts"))]
pub const fn log_feature_error(self) {
let error_message = || {
format!("{self:?} tonemapping requires the `tonemapping_luts` feature.
Either enable the `tonemapping_luts` feature for bevy in `Cargo.toml` (recommended),
or use a different `Tonemapping` method in your `Camera2dBundle`/`Camera3dBundle`.")
};
pub fn log_feature_error(self) {
if matches!(self, Self::AgX | Self::TonyMcMapface | Self::BlenderFilmic) {
bevy_log::error!(error_message());
bevy_log::error!(
"{self:?} tonemapping requires the `tonemapping_luts` feature. Either enable the \
`tonemapping_luts` feature for bevy in `Cargo.toml` (recommended), or use a \
different `Tonemapping` method in your `Camera2dBundle`/`Camera3dBundle`."
);
}
}
}
Expand Down

0 comments on commit ff1470f

Please sign in to comment.