Skip to content

Commit 1200650

Browse files
committed
Fix lints slightly differently
1 parent c10386d commit 1200650

8 files changed

Lines changed: 17 additions & 21 deletions

File tree

src/painter/canvas.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,15 @@ pub trait CanvasCommands<'w> {
217217
///
218218
/// Returns the created [`Handle<Image>`] and [`EntityCommands`].
219219
fn spawn_canvas(
220-
&'_ mut self,
220+
&mut self,
221221
assets: &mut Assets<Image>,
222222
config: CanvasConfig,
223223
) -> (Handle<Image>, EntityCommands<'_>);
224224
}
225225

226226
impl<'w, 's> CanvasCommands<'w> for Commands<'w, 's> {
227227
fn spawn_canvas(
228-
&'_ mut self,
228+
&mut self,
229229
assets: &mut Assets<Image>,
230230
config: CanvasConfig,
231231
) -> (Handle<Image>, EntityCommands<'_>) {

src/painter/child_commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ pub struct ShapeChildBuilder<'w> {
7474
impl<'w> ShapeChildBuilder<'w> {
7575
/// Spawns an entity with the given bundle and inserts it into the parent entity's [`Children`].
7676
/// Also adds [`Parent`] component to the created entity.
77-
pub fn spawn(&'_ mut self, bundle: impl Bundle) -> EntityCommands<'_> {
77+
pub fn spawn(&mut self, bundle: impl Bundle) -> EntityCommands<'_> {
7878
let e = self.commands.spawn(bundle);
7979
self.push_children.children.push(e.id());
8080
e
8181
}
8282

8383
/// Spawns an [`Entity`] with no components and inserts it into the parent entity's [`Children`].
8484
/// Also adds [`Parent`] component to the created entity.
85-
pub fn spawn_empty(&'_ mut self) -> EntityCommands<'_> {
85+
pub fn spawn_empty(&mut self) -> EntityCommands<'_> {
8686
let e = self.commands.spawn_empty();
8787
self.push_children.children.push(e.id());
8888
e
@@ -101,7 +101,7 @@ impl<'w> ShapeChildBuilder<'w> {
101101
}
102102

103103
impl<'w> ShapeSpawner<'w> for ShapeChildBuilder<'w> {
104-
fn spawn_shape(&'_ mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_> {
104+
fn spawn_shape(&mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_> {
105105
let Self {
106106
commands, config, ..
107107
} = self;

src/painter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub trait ShapeSpawner<'w>: DerefMut<Target = ShapeConfig> {
2828
/// Note: [`ShapeBundle`](crate::ShapeBundle) does not include [`RenderLayers`](bevy::render::view::RenderLayers) as there is no support for optional components
2929
/// so instead it is inserted in this function conditionally depending on the [`ShapeConfig`] in `self`
3030
/// Prefer the function for the shape you want over [`ShapeSpawner::spawn_shape`], e.g. `commands.rect(...)`
31-
fn spawn_shape(&'_ mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_>;
31+
fn spawn_shape(&mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_>;
3232
}
3333

3434
/// Plugin that setups up resources and systems for [`Canvas`] and [`ShapePainter`].

src/painter/shape_commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<'w, 's> ShapeCommands<'w, 's> {
2525
}
2626

2727
impl<'w, 's> ShapeSpawner<'w> for ShapeCommands<'w, 's> {
28-
fn spawn_shape(&'_ mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_> {
28+
fn spawn_shape(&mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_> {
2929
let Self {
3030
commands, config, ..
3131
} = self;

src/shapes/disc.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,18 @@ impl DiscBundle for ShapeBundle<DiscComponent> {
234234

235235
/// Extension trait for [`ShapeSpawner`] to enable spawning of entities for disc type shapes.
236236
pub trait DiscSpawner<'w> {
237-
fn circle(&'_ mut self, radius: f32) -> ShapeEntityCommands<'_, '_>;
238-
fn arc(
239-
&'_ mut self,
240-
radius: f32,
241-
start_angle: f32,
242-
end_angle: f32,
243-
) -> ShapeEntityCommands<'_, '_>;
237+
fn circle(&mut self, radius: f32) -> ShapeEntityCommands<'_, '_>;
238+
fn arc(&mut self, radius: f32, start_angle: f32, end_angle: f32)
239+
-> ShapeEntityCommands<'_, '_>;
244240
}
245241

246242
impl<'w, T: ShapeSpawner<'w>> DiscSpawner<'w> for T {
247-
fn circle(&'_ mut self, radius: f32) -> ShapeEntityCommands<'_, '_> {
243+
fn circle(&mut self, radius: f32) -> ShapeEntityCommands<'_, '_> {
248244
self.spawn_shape(ShapeBundle::circle(self.config(), radius))
249245
}
250246

251247
fn arc(
252-
&'_ mut self,
248+
&mut self,
253249
radius: f32,
254250
start_angle: f32,
255251
end_angle: f32,

src/shapes/line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl LineBundle for ShapeBundle<LineComponent> {
159159

160160
/// Extension trait for [`ShapeSpawner`] to enable spawning of line entities.
161161
pub trait LineSpawner<'w>: ShapeSpawner<'w> {
162-
fn line(&'_ mut self, start: Vec3, end: Vec3) -> ShapeEntityCommands<'_, '_>;
162+
fn line(&mut self, start: Vec3, end: Vec3) -> ShapeEntityCommands<'_, '_>;
163163
}
164164

165165
impl<'w, T: ShapeSpawner<'w>> LineSpawner<'w> for T {

src/shapes/rectangle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ impl RectangleBundle for ShapeBundle<RectangleComponent> {
163163

164164
/// Extension trait for [`ShapeSpawner`] to enable spawning of rectangle entities.
165165
pub trait RectangleSpawner<'w> {
166-
fn rect(&'_ mut self, size: Vec2) -> ShapeEntityCommands<'_, '_>;
166+
fn rect(&mut self, size: Vec2) -> ShapeEntityCommands<'_, '_>;
167167
}
168168

169169
impl<'w, T: ShapeSpawner<'w>> RectangleSpawner<'w> for T {
170-
fn rect(&'_ mut self, size: Vec2) -> ShapeEntityCommands<'_, '_> {
170+
fn rect(&mut self, size: Vec2) -> ShapeEntityCommands<'_, '_> {
171171
self.spawn_shape(ShapeBundle::rect(self.config(), size))
172172
}
173173
}

src/shapes/triangle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ impl TriangleBundle for ShapeBundle<TriangleComponent> {
177177

178178
/// Extension trait for [`ShapeSpawner`] to enable spawning of triangle entities.
179179
pub trait TriangleSpawner<'w> {
180-
fn triangle(&'_ mut self, v_a: Vec2, v_b: Vec2, v_c: Vec2) -> ShapeEntityCommands<'_, '_>;
180+
fn triangle(&mut self, v_a: Vec2, v_b: Vec2, v_c: Vec2) -> ShapeEntityCommands<'_, '_>;
181181
}
182182

183183
impl<'w, T: ShapeSpawner<'w>> TriangleSpawner<'w> for T {
184-
fn triangle(&'_ mut self, v_a: Vec2, v_b: Vec2, v_c: Vec2) -> ShapeEntityCommands<'_, '_> {
184+
fn triangle(&mut self, v_a: Vec2, v_b: Vec2, v_c: Vec2) -> ShapeEntityCommands<'_, '_> {
185185
self.spawn_shape(ShapeBundle::triangle(self.config(), v_a, v_b, v_c))
186186
}
187187
}

0 commit comments

Comments
 (0)