Skip to content

Commit d98861c

Browse files
authored
followup to #24033 must_use on SceneScope/SceneListScop (#24040)
# Objective See for more details - #24033 tldr: prevent accidental `;` in `-> impl SceneList`/`-> impl SceneList` functions from just being accepted ## Solution add `#[must_use]` to `SceneScope` and `SceneListScope` as recommended by @chescock ## Testing - [x] cargo test - [x] adding semicolon to a feathers `-> impl Scene` function to see the must use error idk, its an attribute, theres not much to test
1 parent 8473b26 commit d98861c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

crates/bevy_scene/src/scene.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ impl Scene for NameEntityReference {
460460

461461
/// A [`Scene`] that will create a new "entity scope" and fully resolve the given scene `S` on top of the current [`ResolvedScene`] (using that scope).
462462
/// It is not "inherited" or cached.
463+
#[must_use]
463464
pub struct SceneScope<S: Scene>(pub S);
464465

465466
impl<S: Scene> Scene for SceneScope<S> {
@@ -478,6 +479,7 @@ impl<S: Scene> Scene for SceneScope<S> {
478479

479480
/// A [`SceneList`] that will create a new "entity scope" and fully resolve the given scene list `L` on top of the current [`Vec<ResolvedScene>`]
480481
/// (using that scope). It is not "inherited" or cached.
482+
#[must_use]
481483
pub struct SceneListScope<L: SceneList>(pub L);
482484

483485
impl<L: SceneList> SceneList for SceneListScope<L> {

0 commit comments

Comments
 (0)