Skip to content

Commit 7117a1b

Browse files
committed
sec1: Array conversions should not fail.
1 parent 5c1c339 commit 7117a1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sec1/src/point.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ where
210210
}
211211

212212
let (x_bytes, y_bytes) = self.bytes[1..].split_at(Size::to_usize());
213-
let x = Array::from_slice(x_bytes);
213+
let x = x_bytes.try_into().expect("size invariants were violated");
214214

215215
if self.is_compressed() {
216216
Coordinates::Compressed {
@@ -222,7 +222,7 @@ where
222222
} else {
223223
Coordinates::Uncompressed {
224224
x,
225-
y: Array::from_slice(y_bytes),
225+
y: y_bytes.try_into().expect("size invariants were violated"),
226226
}
227227
}
228228
}

0 commit comments

Comments
 (0)