Skip to content

Commit b7b2001

Browse files
committed
Fix clippy errors
1 parent fa6ef71 commit b7b2001

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

splashsurf/src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ pub fn to_binary_f32<R: Real, P: AsRef<Path>>(file: P, values: &[R]) -> Result<(
287287

288288
for v in values {
289289
let v_f32 = v.to_f32().unwrap();
290-
writer.write(&v_f32.to_ne_bytes())?;
290+
writer.write_all(&v_f32.to_ne_bytes())?;
291291
}
292292

293293
Ok(())

splashsurf_lib/src/io/bgeo_format.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ mod parser {
481481

482482
/// Parses a single BGEO attribute definition
483483
fn parse_attr_def(input: &[u8]) -> IResult<&[u8], AttribDefinition, BgeoParserError<&[u8]>> {
484-
let input = input;
485484
let (input, name_length) = number::be_u16(input)?;
486485
let (input, name) = map_res(take(name_length as usize), |input: &[u8]| {
487486
std::str::from_utf8(input).map_err(|_| BgeoParserErrorKind::InvalidAttributeName)

splashsurf_lib/src/postprocessing.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,7 @@ pub fn convert_tris_to_quads<R: Real>(
803803
// Check normal deviation of triangles
804804
if convert {
805805
let dot_i_j = tri_normals[i].dot(&tri_normals[j]);
806-
if dot_i_j >= min_dot {
807-
convert = convert;
808-
} else {
809-
convert = false;
810-
}
806+
convert = dot_i_j >= min_dot;
811807
}
812808

813809
if convert {

splashsurf_lib/src/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ impl<'a, T> UnsafeSlice<'a, T> {
7979
}
8080

8181
/// Returns a mutable reference to an element of the wrapped slice without doing bounds checking, simultaneous access has to be disjoint!
82-
/// SAFETY: It is UB to obtain two mutable references to the same index.
82+
/// SAFETY: It is unsound to obtain two mutable references to the same index.
83+
#[allow(clippy::mut_from_ref)]
8384
pub unsafe fn get_mut_unchecked(&self, i: usize) -> &mut T {
8485
debug_assert!(i < self.len(), "index out of bounds");
8586
&mut *self.slice.get_unchecked(i).get()

0 commit comments

Comments
 (0)