Skip to content

Commit 70ae180

Browse files
committed
Generic support for loading vectors, too
1 parent 8e97eec commit 70ae180

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cli/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ impl FloatVectorFormat {
322322
reader.read_exact(&mut buf).with_context(|| {
323323
format!("Could not read value at index {i} from {}", path_display)
324324
})?;
325-
let bytes = buf.as_slice().into();
325+
let bytes = buf.as_slice().try_into().map_err(|_| {
326+
anyhow!("Could not convert bytes at index {i} in {}", path_display)
327+
})?;
326328
result.push(F::from_be_bytes(bytes));
327329
}
328330
Ok(result)

0 commit comments

Comments
 (0)