bevy/crates/bevy_ecs/src/schedule
Christopher Durham a60fe30ada Avoid some format! into immediate format! (#2913)
# Objective

- Avoid usages of `format!` that ~immediately get passed to another `format!`. This avoids a temporary allocation and is just generally cleaner.

## Solution

- `bevy_derive::shader_defs` does a `format!("{}", val.to_string())`, which is better written as just `format!("{}", val)`
- `bevy_diagnostic::log_diagnostics_plugin` does a `format!("{:>}", format!(...))`, which is better written as `format!("{:>}", format_args!(...))`
- `bevy_ecs::schedule` does `tracing::info!(..., name = &*format!("{:?}", val))`, which is better written with the tracing shorthand `tracing::info!(..., name = ?val)`
- `bevy_reflect::reflect` does `f.write_str(&format!(...))`, which is better written as `write!(f, ...)` (this could also be written using `f.debug_tuple`, but I opted to maintain alt debug behavior)
- `bevy_reflect::serde::{ser, de}` do `serde::Error::custom(format!(...))`, which is better written as `Error::custom(format_args!(...))`, as `Error::custom` takes `impl Display` and just immediately calls `format!` again
2021-10-06 18:34:33 +00:00
..
executor_parallel.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
executor.rs small ecs cleanup and remove_bundle drop bugfix (#2172) 2021-05-18 19:25:57 +00:00
graph_utils.rs Fix some nightly clippy lints (#2522) 2021-07-29 20:52:15 +00:00
label.rs System sets and run criteria v2 (#1675) 2021-03-24 20:11:55 +00:00
mod.rs Avoid some format! into immediate format! (#2913) 2021-10-06 18:34:33 +00:00
run_criteria.rs Unique WorldId (#2827) 2021-09-30 20:54:47 +00:00
stage.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
state.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
system_container.rs Reduce visibility of various types and fields (#2690) 2021-08-19 20:02:25 +00:00
system_descriptor.rs Implement IntoSystemDescriptor for SystemDescriptor (#2718) 2021-08-24 17:46:53 +00:00
system_set.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00