Skip to content

Commit 764956f

Browse files
bushrat011899ecoskey
authored andcommitted
Fixed issue with derive_more Display Implementations (bevyengine#16298)
# Objective - Fixed issue where `thiserror` `#[error(...)]` attributes were improperly converted to `derive_more` `#[display(...)]` equivalents in certain cases with a tuple struct/enum variant. ## Solution - Used `re/#\[display\(.*\{[0-9]+\}.*\)\]/` to find occurences of using `{0}` where `{_0}` was intended (checked for other field indexes too)and updated accordingly. ## Testing - `cargo check` - CI ## Notes This was discovered by @dtolnay in [this comment](bevyengine#15772 (comment)).
1 parent d3ff926 commit 764956f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/bevy_ecs/src/schedule/schedule.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,13 +1961,13 @@ pub enum ScheduleBuildError {
19611961
#[display("System dependencies contain cycle(s).\n{_0}")]
19621962
DependencyCycle(String),
19631963
/// Tried to order a system (set) relative to a system set it belongs to.
1964-
#[display("`{0}` and `{_1}` have both `in_set` and `before`-`after` relationships (these might be transitive). This combination is unsolvable as a system cannot run before or after a set it belongs to.")]
1964+
#[display("`{_0}` and `{_1}` have both `in_set` and `before`-`after` relationships (these might be transitive). This combination is unsolvable as a system cannot run before or after a set it belongs to.")]
19651965
CrossDependency(String, String),
19661966
/// Tried to order system sets that share systems.
1967-
#[display("`{0}` and `{_1}` have a `before`-`after` relationship (which may be transitive) but share systems.")]
1967+
#[display("`{_0}` and `{_1}` have a `before`-`after` relationship (which may be transitive) but share systems.")]
19681968
SetsHaveOrderButIntersect(String, String),
19691969
/// Tried to order a system (set) relative to all instances of some system function.
1970-
#[display("Tried to order against `{0}` in a schedule that has more than one `{0}` instance. `{_0}` is a `SystemTypeSet` and cannot be used for ordering if ambiguous. Use a different set without this restriction.")]
1970+
#[display("Tried to order against `{_0}` in a schedule that has more than one `{_0}` instance. `{_0}` is a `SystemTypeSet` and cannot be used for ordering if ambiguous. Use a different set without this restriction.")]
19711971
SystemTypeSetAmbiguity(String),
19721972
/// Systems with conflicting access have indeterminate run order.
19731973
///

crates/bevy_gltf/src/vertex_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub(crate) enum ConvertAttributeError {
248248
"Vertex attribute {_0} has format {_1:?} but expected {_3:?} for target attribute {_2}"
249249
)]
250250
WrongFormat(String, VertexFormat, String, VertexFormat),
251-
#[display("{0} in accessor {_1}")]
251+
#[display("{_0} in accessor {_1}")]
252252
AccessFailed(AccessFailed, usize),
253253
#[display("Unknown vertex attribute {_0}")]
254254
UnknownName(String),

0 commit comments

Comments
 (0)