Skip to content

Commit d1f4014

Browse files
mtsrcart
andcommitted
Allows a number of clippy lints and fixes 2 (#1999)
Co-authored-by: Carter Anderson <[email protected]>
1 parent cdae95b commit d1f4014

File tree

15 files changed

+19
-11
lines changed

15 files changed

+19
-11
lines changed

crates/bevy_ecs/src/bundle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub struct BundleInfo {
124124
impl BundleInfo {
125125
/// # Safety
126126
/// table row must exist, entity must be valid
127-
#[allow(clippy::clippy::too_many_arguments)]
127+
#[allow(clippy::too_many_arguments)]
128128
#[inline]
129129
pub(crate) unsafe fn write_components<T: Bundle>(
130130
&self,

crates/bevy_ecs/src/system/into_system.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ where
119119
system_state: SystemState,
120120
config: Option<<Param::Fetch as SystemParamState>::Config>,
121121
// NOTE: PhantomData<fn()-> T> gives this safe Send/Sync impls
122+
#[allow(clippy::type_complexity)]
122123
marker: PhantomData<fn() -> (In, Out, Marker)>,
123124
}
124125

crates/bevy_reflect/src/type_registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ pub trait FromType<T> {
227227

228228
#[derive(Clone)]
229229
pub struct ReflectDeserialize {
230+
#[allow(clippy::type_complexity)]
230231
pub func: fn(
231232
deserializer: &mut dyn erased_serde::Deserializer,
232233
) -> Result<Box<dyn Reflect>, erased_serde::Error>,

crates/bevy_render/src/camera/camera.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ impl Camera {
6363
}
6464
}
6565

66+
#[allow(clippy::type_complexity)]
6667
pub fn camera_system<T: CameraProjection + Component>(
6768
mut window_resized_events: EventReader<WindowResized>,
6869
mut window_created_events: EventReader<WindowCreated>,

crates/bevy_render/src/mesh/mesh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ pub struct MeshResourceProviderState {
505505
mesh_entities: HashMap<Handle<Mesh>, MeshEntities>,
506506
}
507507

508+
#[allow(clippy::type_complexity)]
508509
pub fn mesh_resource_provider_system(
509510
mut state: Local<MeshResourceProviderState>,
510511
render_resource_context: Res<Box<dyn RenderResourceContext>>,

crates/bevy_render/src/mesh/shape/capsule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Default for CapsuleUvProfile {
5252
}
5353

5454
impl From<Capsule> for Mesh {
55-
#[allow(clippy::clippy::needless_range_loop)]
55+
#[allow(clippy::needless_range_loop)]
5656
fn from(capsule: Capsule) -> Self {
5757
// code adapted from https://behreajj.medium.com/making-a-capsule-mesh-via-script-in-five-3d-environments-c2214abf02db
5858

crates/bevy_render/src/render_graph/nodes/render_resources_node.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ impl<I, T: RenderResources> Default for RenderResourcesNodeState<I, T> {
428428
}
429429
}
430430

431+
#[allow(clippy::type_complexity)]
431432
fn render_resources_node_system<T: RenderResources>(
432433
mut state: Local<RenderResourcesNodeState<Entity, T>>,
433434
mut entities_waiting_for_textures: Local<Vec<Entity>>,
@@ -610,7 +611,7 @@ impl<T: Asset> Default for AssetRenderNodeState<T> {
610611
}
611612
}
612613

613-
#[allow(clippy::too_many_arguments)]
614+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
614615
fn asset_render_resources_node_system<T: RenderResources + Asset>(
615616
mut state: Local<RenderResourcesNodeState<HandleId, T>>,
616617
mut asset_state: Local<AssetRenderNodeState<T>>,

crates/bevy_render/src/wireframe/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl Default for WireframeConfig {
5555
}
5656
}
5757

58+
#[allow(clippy::type_complexity)]
5859
pub fn draw_wireframes_system(
5960
mut draw_context: DrawContext,
6061
msaa: Res<Msaa>,

crates/bevy_sprite/src/color_material.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl From<Handle<Texture>> for ColorMaterial {
5959

6060
// Temporary solution for sub-assets change handling, see https://github.com/bevyengine/bevy/issues/1161#issuecomment-780467768
6161
// TODO: should be removed when pipelined rendering is done
62+
#[allow(clippy::type_complexity)]
6263
pub(crate) fn material_texture_detection_system(
6364
mut texture_to_material: Local<HashMap<Handle<Texture>, HashSet<Handle<ColorMaterial>>>>,
6465
mut material_to_texture: Local<HashMap<Handle<ColorMaterial>, Handle<Texture>>>,

crates/bevy_text/src/text2d.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl Default for Text2dBundle {
5757
/// System for drawing text in a 2D scene via a 2D `OrthographicCameraBundle`. Included in the
5858
/// default `TextPlugin`. Position is determined by the `Transform`'s translation, though scale and
5959
/// rotation are ignored.
60+
#[allow(clippy::type_complexity)]
6061
pub fn draw_text2d_system(
6162
mut context: DrawContext,
6263
msaa: Res<Msaa>,
@@ -125,7 +126,7 @@ pub struct QueuedText2d {
125126
}
126127

127128
/// Updates the TextGlyphs with the new computed glyphs from the layout
128-
#[allow(clippy::too_many_arguments)]
129+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
129130
pub fn text2d_system(
130131
mut queued_text: Local<QueuedText2d>,
131132
mut textures: ResMut<Assets<Texture>>,

crates/bevy_ui/src/flex/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub enum FlexError {
195195
StretchError(stretch::Error),
196196
}
197197

198-
#[allow(clippy::too_many_arguments)]
198+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
199199
pub fn flex_node_system(
200200
windows: Res<Windows>,
201201
mut scale_factor_events: EventReader<WindowScaleFactorChanged>,

crates/bevy_ui/src/focus.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub struct State {
3939
entities_to_reset: SmallVec<[Entity; 1]>,
4040
}
4141

42+
#[allow(clippy::type_complexity)]
4243
pub fn ui_focus_system(
4344
mut state: Local<State>,
4445
windows: Res<Windows>,

crates/bevy_ui/src/widget/text.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn text_constraint(min_size: Val, size: Val, max_size: Val, scale_factor: f6
4242

4343
/// Computes the size of a text block and updates the TextGlyphs with the
4444
/// new computed glyphs from the layout
45-
#[allow(clippy::too_many_arguments)]
45+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
4646
pub fn text_system(
4747
mut queued_text: Local<QueuedText>,
4848
mut last_scale_factor: Local<f64>,
@@ -139,7 +139,7 @@ pub fn text_system(
139139
queued_text.entities = new_queue;
140140
}
141141

142-
#[allow(clippy::too_many_arguments)]
142+
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
143143
pub fn draw_text_system(
144144
mut context: DrawContext,
145145
msaa: Res<Msaa>,

crates/bevy_wgpu/src/wgpu_type_converter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl WgpuFrom<BufferUsage> for wgpu::BufferUsage {
146146
impl WgpuFrom<&LoadOp<Color>> for wgpu::LoadOp<wgpu::Color> {
147147
fn from(val: &LoadOp<Color>) -> Self {
148148
match val {
149-
LoadOp::Clear(value) => wgpu::LoadOp::Clear(value.clone().wgpu_into()),
149+
LoadOp::Clear(value) => wgpu::LoadOp::Clear((*value).wgpu_into()),
150150
LoadOp::Load => wgpu::LoadOp::Load,
151151
}
152152
}

crates/bevy_winit/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ fn change_window(world: &mut World) {
152152
width: constraints.max_width,
153153
height: constraints.max_height,
154154
};
155+
156+
window.set_min_inner_size(Some(min_inner_size));
155157
if constraints.max_width.is_finite() && constraints.max_height.is_finite() {
156-
window.set_min_inner_size(Some(min_inner_size));
157158
window.set_max_inner_size(Some(max_inner_size));
158-
} else {
159-
window.set_min_inner_size(Some(min_inner_size));
160159
}
161160
}
162161
}

0 commit comments

Comments
 (0)