Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ipadjen committed Jan 31, 2023
1 parent f4d972a commit 6cad6b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,9 +1526,10 @@ where
.filter_map(|position| {
let position: &[Float; N] = &unsafe { *(position.as_ptr() as *const [Float; N]) };

// Ugly, but f32 has no Eq and no Hash.
let bitpattern =
unsafe { std::mem::transmute::<&[Float; N], &[u8; size_of::<[Float; N]>()]>(position) };
// Ugly, but floats have no Eq and no Hash.
let bitpattern = unsafe {
std::mem::transmute::<&[Float; N], &[u8; size_of::<[Float; N]>()]>(position)
};

match canonical_indices.get(bitpattern) {
Some(&other_index) => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use float_eq::assert_float_eq;
use std::{
env,
fs::File,
io::{BufReader, Cursor},
};
use float_eq::assert_float_eq;

use crate as tobj;

Expand Down

0 comments on commit 6cad6b3

Please sign in to comment.