Skip to content

Commit

Permalink
Fix clippy 1.81 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwanders committed Sep 22, 2024
1 parent 7a689fe commit 9695c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion battleground_construct/src/units/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl ComponentBox {
};

let error = setpoint - revolute.position();
revolute.set_velocity_cmd(error.min(0.3).max(-0.3));
revolute.set_velocity_cmd(error.clamp(-0.3, 0.3));

if error.abs() < 0.05 {
revolute.set_velocity_cmd(0.0);
Expand Down
6 changes: 2 additions & 4 deletions battleground_unit_control/src/register_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Register {
value: Value::Bytes {
values: vec![],
min_len: 0,
max_len: std::usize::MAX,
max_len: usize::MAX,
},
}
}
Expand Down Expand Up @@ -244,9 +244,7 @@ impl RegisterInterface {
);
}

pub fn add_module<M: UnitModule>(&mut self, name: &str, index: ModuleId, handler: M)
where
M: Sized + 'static,
pub fn add_module<M: UnitModule + Sized + 'static>(&mut self, name: &str, index: ModuleId, handler: M)
{
self.modules.insert(
index,
Expand Down
10 changes: 5 additions & 5 deletions battleground_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ impl ConstructViewer {
.clear(ClearState::color_and_depth(0.8, 0.8, 0.8, 1.0, 1.0))
.render(
&self.camera,
&self.construct_render.objects(RenderPass::BaseScene),
self.construct_render.objects(RenderPass::BaseScene),
&[&self.ambient_light, &self.directional_light],
);
screen
// .clear(ClearState::color_and_depth(0.8, 0.8, 0.8, 1.0, 1.0))
.render(
&self.camera,
&self.construct_render.objects(RenderPass::BaseSceneOverlay),
self.construct_render.objects(RenderPass::BaseSceneOverlay),
&[&self.ambient_light, &self.directional_light],
);
// B1) Render depth buffer with non-emissives
Expand All @@ -364,7 +364,7 @@ impl ConstructViewer {
.render_with_material(
&write_depth_material,
&self.camera,
&self.construct_render.objects(RenderPass::NonGlowDepths),
self.construct_render.objects(RenderPass::NonGlowDepths),
&[],
);

Expand All @@ -386,7 +386,7 @@ impl ConstructViewer {
)
.render(
&self.camera,
&self.construct_render.objects(RenderPass::GlowSources),
self.construct_render.objects(RenderPass::GlowSources),
&[],
);

Expand All @@ -395,7 +395,7 @@ impl ConstructViewer {
screen.render_with_material(
&fence_material,
&self.camera,
&self.construct_render.objects(RenderPass::Fences),
self.construct_render.objects(RenderPass::Fences),
&[],
);

Expand Down

0 comments on commit 9695c36

Please sign in to comment.