Skip to content

Commit 385daff

Browse files
committed
Clippy.
1 parent 9063975 commit 385daff

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

crates/processing_render/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod error;
22
pub mod render;
33

4-
use std::{cell::RefCell, ffi::c_void, num::NonZero, ptr::NonNull, sync::OnceLock};
4+
use std::{cell::RefCell, num::NonZero, ptr::NonNull, sync::OnceLock};
55

66
use bevy::{
77
app::{App, AppExit},
@@ -27,7 +27,7 @@ use crate::{
2727
static IS_INIT: OnceLock<()> = OnceLock::new();
2828

2929
thread_local! {
30-
static APP: RefCell<Option<App>> = RefCell::new(None);
30+
static APP: RefCell<Option<App>> = const { RefCell::new(None) };
3131
}
3232

3333
#[derive(Resource, Default)]
@@ -112,7 +112,7 @@ fn app<T>(cb: impl FnOnce(&App) -> Result<T>) -> Result<T> {
112112
let app_borrow = app_cell.borrow();
113113
let app = app_borrow
114114
.as_ref()
115-
.ok_or_else(|| error::ProcessingError::AppAccess)?;
115+
.ok_or(error::ProcessingError::AppAccess)?;
116116
cb(app)
117117
})?;
118118
Ok(res)
@@ -123,7 +123,7 @@ fn app_mut<T>(cb: impl FnOnce(&mut App) -> Result<T>) -> Result<T> {
123123
let mut app_borrow = app_cell.borrow_mut();
124124
let app = app_borrow
125125
.as_mut()
126-
.ok_or_else(|| error::ProcessingError::AppAccess)?;
126+
.ok_or(error::ProcessingError::AppAccess)?;
127127
cb(app)
128128
})?;
129129
Ok(res)
@@ -196,8 +196,8 @@ pub fn create_surface(
196196

197197
match content_view {
198198
Some(view) => {
199-
let view_ptr = Retained::as_ptr(&view) as *mut std::ffi::c_void;
200-
view_ptr
199+
200+
Retained::as_ptr(&view) as *mut std::ffi::c_void
201201
}
202202
None => {
203203
return Err(error::ProcessingError::InvalidWindowHandle);
@@ -491,7 +491,7 @@ pub fn exit(exit_code: u8) -> Result<()> {
491491
pub fn background_color(window_entity: Entity, color: Color) -> Result<()> {
492492
app_mut(|app| {
493493
let mut camera_query = app.world_mut().query::<(&mut Camera, &ChildOf)>();
494-
for (mut camera, parent) in camera_query.iter_mut(&mut app.world_mut()) {
494+
for (mut camera, parent) in camera_query.iter_mut(app.world_mut()) {
495495
if parent.parent() == window_entity {
496496
camera.clear_color = ClearColorConfig::Custom(color);
497497
}

crates/processing_render/src/render/primitive/rect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ fn simple_rect(mesh: &mut Mesh, x: f32, y: f32, w: f32, h: f32, color: Color) {
101101
}
102102

103103
if let Some(Indices::U32(indices)) = mesh.indices_mut() {
104-
indices.push(base_idx + 0);
104+
indices.push(base_idx);
105105
indices.push(base_idx + 1);
106106
indices.push(base_idx + 2);
107107

108-
indices.push(base_idx + 0);
108+
indices.push(base_idx);
109109
indices.push(base_idx + 2);
110110
indices.push(base_idx + 3);
111111
}

0 commit comments

Comments
 (0)