diff --git a/benches/Cargo.toml b/benches/Cargo.toml index becb6cff4e..ea1992f648 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -60,6 +60,13 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] } unsafe_op_in_unsafe_fn = "warn" unused_qualifications = "warn" +[lib] +# This fixes the "Unrecognized Option" error when running commands like +# `cargo bench -- --save-baseline before` by disabling the default benchmark harness. +# See +# for more information. +bench = false + [[bench]] name = "ecs" path = "benches/bevy_ecs/main.rs" diff --git a/crates/bevy_render/src/extract_resource.rs b/crates/bevy_render/src/extract_resource.rs index 62c25aef17..cec8647ffc 100644 --- a/crates/bevy_render/src/extract_resource.rs +++ b/crates/bevy_render/src/extract_resource.rs @@ -4,7 +4,6 @@ use bevy_app::{App, Plugin}; use bevy_ecs::prelude::*; pub use bevy_render_macros::ExtractResource; use bevy_utils::once; -use tracing::{error, warn}; use crate::{Extract, ExtractSchedule, RenderApp}; @@ -36,7 +35,7 @@ impl Plugin for ExtractResourcePlugin { if let Some(render_app) = app.get_sub_app_mut(RenderApp) { render_app.add_systems(ExtractSchedule, extract_resource::); } else { - once!(error!( + once!(tracing::error!( "Render app did not exist when trying to add `extract_resource` for <{}>.", core::any::type_name::() )); @@ -58,12 +57,13 @@ pub fn extract_resource( } else { #[cfg(debug_assertions)] if !main_resource.is_added() { - once!(warn!( + once!(tracing::warn!( "Removing resource {} from render world not expected, adding using `Commands`. This may decrease performance", core::any::type_name::() )); } + commands.insert_resource(R::extract_resource(main_resource)); } }