chore: clippy fixes

This commit is contained in:
Sébastien Crozet
2024-06-09 11:12:31 +02:00
committed by Sébastien Crozet
parent edaa36ac7e
commit ad960bf245
7 changed files with 16 additions and 12 deletions

View File

@@ -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
}

View File

@@ -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)
}))
}
}

View File

@@ -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))