aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Crozet <sebcrozet@dimforge.com>2024-06-09 11:12:31 +0200
committerSébastien Crozet <sebastien@crozet.re>2024-06-09 12:09:58 +0200
commitad960bf2458bd907942b1f236438f42f3194a6f6 (patch)
treeedffab69df8c40a2f1767baed63c3c2545cf1eeb
parentedaa36ac7e702f419faab4ff1b9af858fc84177f (diff)
downloadrapier-ad960bf2458bd907942b1f236438f42f3194a6f6.tar.gz
rapier-ad960bf2458bd907942b1f236438f42f3194a6f6.tar.bz2
rapier-ad960bf2458bd907942b1f236438f42f3194a6f6.zip
chore: clippy fixes
-rw-r--r--benchmarks2d/all_benchmarks2.rs4
-rw-r--r--crates/rapier3d-urdf/src/lib.rs4
-rw-r--r--examples2d/all_examples2.rs2
-rw-r--r--examples3d-f64/all_examples3-f64.rs4
-rw-r--r--src/dynamics/joint/generic_joint.rs4
-rw-r--r--src/geometry/interaction_graph.rs8
-rw-r--r--src/geometry/mesh_converter.rs2
7 files changed, 16 insertions, 12 deletions
diff --git a/benchmarks2d/all_benchmarks2.rs b/benchmarks2d/all_benchmarks2.rs
index 3f98fb4..c3ba5bd 100644
--- a/benchmarks2d/all_benchmarks2.rs
+++ b/benchmarks2d/all_benchmarks2.rs
@@ -31,7 +31,7 @@ fn demo_name_from_command_line() -> Option<String> {
None
}
-#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))]
+#[cfg(target_arch = "wasm32")]
fn demo_name_from_url() -> Option<String> {
None
// let window = stdweb::web::window();
@@ -39,7 +39,7 @@ fn demo_name_from_url() -> Option<String> {
// Some(hash[1..].to_string())
}
-#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))]
+#[cfg(not(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option<String> {
None
}
diff --git a/crates/rapier3d-urdf/src/lib.rs b/crates/rapier3d-urdf/src/lib.rs
index 0a9a2fc..bad12ee 100644
--- a/crates/rapier3d-urdf/src/lib.rs
+++ b/crates/rapier3d-urdf/src/lib.rs
@@ -220,7 +220,7 @@ enum JointType {
impl JointType {
fn from_str(str: &str) -> Option<Self> {
- match str.as_ref() {
+ match str {
"fixed" | "Fixed" => Some(Self::Fixed),
"continuous" | "Continuous" => Some(Self::Continuous),
"revolute" | "Revolute" => Some(Self::Revolute),
@@ -519,7 +519,7 @@ fn urdf_to_collider(
Some("stl") | Some("STL") => {
let full_path = mesh_dir.join(filename);
match rapier3d_stl::load_from_path(
- &full_path,
+ full_path,
MeshConverter::TriMeshWithFlags(options.trimesh_flags),
scale,
) {
diff --git a/examples2d/all_examples2.rs b/examples2d/all_examples2.rs
index 6113df4..3d065a5 100644
--- a/examples2d/all_examples2.rs
+++ b/examples2d/all_examples2.rs
@@ -56,7 +56,7 @@ fn demo_name_from_command_line() -> Option<String> {
None
}
-#[cfg(any(target_arch = "wasm32"))]
+#[cfg(target_arch = "wasm32")]
fn demo_name_from_url() -> Option<String> {
None
// let window = stdweb::web::window();
diff --git a/examples3d-f64/all_examples3-f64.rs b/examples3d-f64/all_examples3-f64.rs
index c381eec..f2d5ec4 100644
--- a/examples3d-f64/all_examples3-f64.rs
+++ b/examples3d-f64/all_examples3-f64.rs
@@ -23,7 +23,7 @@ fn demo_name_from_command_line() -> Option<String> {
None
}
-#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))]
+#[cfg(target_arch = "wasm32")]
fn demo_name_from_url() -> Option<String> {
None
// let window = stdweb::web::window();
@@ -35,7 +35,7 @@ fn demo_name_from_url() -> Option<String> {
// }
}
-#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))]
+#[cfg(not(target_arch = "wasm32"))]
fn demo_name_from_url() -> Option<String> {
None
}
diff --git a/src/dynamics/joint/generic_joint.rs b/src/dynamics/joint/generic_joint.rs
index 2651592..154c439 100644
--- a/src/dynamics/joint/generic_joint.rs
+++ b/src/dynamics/joint/generic_joint.rs
@@ -524,7 +524,7 @@ macro_rules! joint_conversion_methods(
if self.locked_axes == $axes {
// SAFETY: this is OK because the target joint type is
// a `repr(transparent)` newtype of `Joint`.
- Some(unsafe { std::mem::transmute(self) })
+ Some(unsafe { std::mem::transmute::<&Self, &$Joint>(self) })
} else {
None
}
@@ -536,7 +536,7 @@ macro_rules! joint_conversion_methods(
if self.locked_axes == $axes {
// SAFETY: this is OK because the target joint type is
// a `repr(transparent)` newtype of `Joint`.
- Some(unsafe { std::mem::transmute(self) })
+ Some(unsafe { std::mem::transmute::<&mut Self, &mut $Joint>(self) })
} else {
None
}
diff --git a/src/geometry/interaction_graph.rs b/src/geometry/interaction_graph.rs
index b535fa5..a237a69 100644
--- a/src/geometry/interaction_graph.rs
+++ b/src/geometry/interaction_graph.rs
@@ -232,7 +232,9 @@ impl<'a, N: Copy, E> Iterator for InteractionsWithMut<'a, N, E> {
let endpoints = self.graph.edge_endpoints(edge).unwrap();
let (co1, co2) = (self.graph[endpoints.0], self.graph[endpoints.1]);
let interaction = &mut self.graph[edge];
- return Some((co1, co2, edge, unsafe { std::mem::transmute(interaction) }));
+ return Some((co1, co2, edge, unsafe {
+ std::mem::transmute::<&mut E, &'a mut E>(interaction)
+ }));
}
let edge = self.outgoing_edge?;
@@ -240,6 +242,8 @@ impl<'a, N: Copy, E> Iterator for InteractionsWithMut<'a, N, E> {
let endpoints = self.graph.edge_endpoints(edge).unwrap();
let (co1, co2) = (self.graph[endpoints.0], self.graph[endpoints.1]);
let interaction = &mut self.graph[edge];
- Some((co1, co2, edge, unsafe { std::mem::transmute(interaction) }))
+ Some((co1, co2, edge, unsafe {
+ std::mem::transmute::<&mut E, &'a mut E>(interaction)
+ }))
}
}
diff --git a/src/geometry/mesh_converter.rs b/src/geometry/mesh_converter.rs
index 5d47f79..a4c8861 100644
--- a/src/geometry/mesh_converter.rs
+++ b/src/geometry/mesh_converter.rs
@@ -84,7 +84,7 @@ impl MeshConverter {
}
#[cfg(feature = "dim3")]
MeshConverter::ConvexDecompositionWithParams(params) => {
- SharedShape::convex_decomposition_with_params(&vertices, &indices, &params)
+ SharedShape::convex_decomposition_with_params(&vertices, &indices, params)
}
};
Ok((shape, transform))