Skip to content

Commit 941b2bb

Browse files
Fix nightly clippy lints
1 parent b853543 commit 941b2bb

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/graphics/rc_sprite.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl RcSprite {
105105
/// * color - New color of the sprite
106106
pub fn set_color(&mut self, color: Color) {
107107
if !self.texture_exists() {
108-
eprintln!("{}", ERROR_MSG);
108+
eprintln!("{ERROR_MSG}");
109109
return;
110110
}
111111
unsafe { ffi::sfSprite_setColor(self.sprite.as_ptr(), color) }
@@ -133,7 +133,7 @@ impl RcSprite {
133133
#[must_use]
134134
pub fn color(&self) -> Color {
135135
if !self.texture_exists() {
136-
eprintln!("{}", RETURN_ERROR_MSG);
136+
eprintln!("{RETURN_ERROR_MSG}");
137137
return Default::default();
138138
}
139139
unsafe { ffi::sfSprite_getColor(self.sprite.as_ptr()) }
@@ -151,7 +151,7 @@ impl RcSprite {
151151
#[must_use]
152152
pub fn local_bounds(&self) -> FloatRect {
153153
if !self.texture_exists() {
154-
eprintln!("{}", RETURN_ERROR_MSG);
154+
eprintln!("{RETURN_ERROR_MSG}");
155155
return Default::default();
156156
}
157157
unsafe { ffi::sfSprite_getLocalBounds(self.sprite.as_ptr()) }
@@ -169,7 +169,7 @@ impl RcSprite {
169169
#[must_use]
170170
pub fn global_bounds(&self) -> FloatRect {
171171
if !self.texture_exists() {
172-
eprintln!("{}", RETURN_ERROR_MSG);
172+
eprintln!("{RETURN_ERROR_MSG}");
173173
return Default::default();
174174
}
175175
unsafe { ffi::sfSprite_getGlobalBounds(self.sprite.as_ptr()) }
@@ -181,7 +181,7 @@ impl RcSprite {
181181
#[must_use]
182182
pub fn texture_rect(&self) -> IntRect {
183183
if !self.texture_exists() {
184-
eprintln!("{}", RETURN_ERROR_MSG);
184+
eprintln!("{RETURN_ERROR_MSG}");
185185
return Default::default();
186186
}
187187
unsafe { ffi::sfSprite_getTextureRect(self.sprite.as_ptr()) }
@@ -197,7 +197,7 @@ impl RcSprite {
197197
/// * rectangle - Rectangle defining the region of the texture to display
198198
pub fn set_texture_rect(&mut self, rect: IntRect) {
199199
if !self.texture_exists() {
200-
eprintln!("{}", ERROR_MSG);
200+
eprintln!("{ERROR_MSG}");
201201
return;
202202
}
203203
unsafe { ffi::sfSprite_setTextureRect(self.sprite.as_ptr(), rect) }
@@ -240,77 +240,77 @@ impl Drawable for RcSprite {
240240
impl Transformable for RcSprite {
241241
fn set_position<P: Into<Vector2f>>(&mut self, position: P) {
242242
if !self.texture_exists() {
243-
eprintln!("{}", ERROR_MSG);
243+
eprintln!("{ERROR_MSG}");
244244
return;
245245
}
246246
unsafe { ffi::sfSprite_setPosition(self.sprite.as_ptr(), position.into()) }
247247
}
248248
fn set_rotation(&mut self, angle: f32) {
249249
if !self.texture_exists() {
250-
eprintln!("{}", ERROR_MSG);
250+
eprintln!("{ERROR_MSG}");
251251
return;
252252
}
253253
unsafe { ffi::sfSprite_setRotation(self.sprite.as_ptr(), angle) }
254254
}
255255
fn set_scale<S: Into<Vector2f>>(&mut self, scale: S) {
256256
if !self.texture_exists() {
257-
eprintln!("{}", ERROR_MSG);
257+
eprintln!("{ERROR_MSG}");
258258
return;
259259
}
260260
unsafe { ffi::sfSprite_setScale(self.sprite.as_ptr(), scale.into()) }
261261
}
262262
fn set_origin<O: Into<Vector2f>>(&mut self, origin: O) {
263263
if !self.texture_exists() {
264-
eprintln!("{}", ERROR_MSG);
264+
eprintln!("{ERROR_MSG}");
265265
return;
266266
}
267267
unsafe { ffi::sfSprite_setOrigin(self.sprite.as_ptr(), origin.into()) }
268268
}
269269
fn position(&self) -> Vector2f {
270270
if !self.texture_exists() {
271-
eprintln!("{}", RETURN_ERROR_MSG);
271+
eprintln!("{RETURN_ERROR_MSG}");
272272
return Default::default();
273273
}
274274
unsafe { ffi::sfSprite_getPosition(self.sprite.as_ptr()) }
275275
}
276276
fn rotation(&self) -> f32 {
277277
if !self.texture_exists() {
278-
eprintln!("{}", RETURN_ERROR_MSG);
278+
eprintln!("{RETURN_ERROR_MSG}");
279279
return Default::default();
280280
}
281281
unsafe { ffi::sfSprite_getRotation(self.sprite.as_ptr()) }
282282
}
283283
fn get_scale(&self) -> Vector2f {
284284
if !self.texture_exists() {
285-
eprintln!("{}", RETURN_ERROR_MSG);
285+
eprintln!("{RETURN_ERROR_MSG}");
286286
return Default::default();
287287
}
288288
unsafe { ffi::sfSprite_getScale(self.sprite.as_ptr()) }
289289
}
290290
fn origin(&self) -> Vector2f {
291291
if !self.texture_exists() {
292-
eprintln!("{}", RETURN_ERROR_MSG);
292+
eprintln!("{RETURN_ERROR_MSG}");
293293
return Default::default();
294294
}
295295
unsafe { ffi::sfSprite_getOrigin(self.sprite.as_ptr()) }
296296
}
297297
fn move_<O: Into<Vector2f>>(&mut self, offset: O) {
298298
if !self.texture_exists() {
299-
eprintln!("{}", ERROR_MSG);
299+
eprintln!("{ERROR_MSG}");
300300
return;
301301
}
302302
unsafe { ffi::sfSprite_move(self.sprite.as_ptr(), offset.into()) }
303303
}
304304
fn rotate(&mut self, angle: f32) {
305305
if !self.texture_exists() {
306-
eprintln!("{}", ERROR_MSG);
306+
eprintln!("{ERROR_MSG}");
307307
return;
308308
}
309309
unsafe { ffi::sfSprite_rotate(self.sprite.as_ptr(), angle) }
310310
}
311311
fn scale<F: Into<Vector2f>>(&mut self, factors: F) {
312312
if !self.texture_exists() {
313-
eprintln!("{}", ERROR_MSG);
313+
eprintln!("{ERROR_MSG}");
314314
return;
315315
}
316316
unsafe { ffi::sfSprite_scale(self.sprite.as_ptr(), factors.into()) }

0 commit comments

Comments
 (0)