Skip to content

Commit a30802e

Browse files
authored
fix: Change to compile for wasm32-unknown-unknown target (#80)
1 parent 4af6987 commit a30802e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dataset/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub(crate) fn deserialize_data(
8383
) -> Result<(Vec<f32>, Vec<f32>, usize, usize), io::Error> {
8484
// read the same file back into a Vec of bytes
8585
let (num_samples, num_features) = {
86-
let mut buffer = [0u8; 8];
86+
let mut buffer = [0u8; if cfg!(target_arch = "wasm32") { 4 } else { 8 }];
8787
buffer.copy_from_slice(&bytes[0..8]);
8888
let num_features = usize::from_le_bytes(buffer);
8989
buffer.copy_from_slice(&bytes[8..16]);

0 commit comments

Comments
 (0)