From ace046624d2e23fba67564a86af7f03ed8a48eae Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 29 Feb 2024 21:05:10 -0500 Subject: remove unwraps, fix utf8 --- matrix-std/src/iter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'matrix-std/src/iter.rs') diff --git a/matrix-std/src/iter.rs b/matrix-std/src/iter.rs index 638755c..c0e0c63 100644 --- a/matrix-std/src/iter.rs +++ b/matrix-std/src/iter.rs @@ -365,7 +365,7 @@ fn unzip((vm, frame): VmArgs, args: Vec) -> Result { if vals.len() != 2 { return error!("unzip only works over a iterator of pairs"); } - let [l, r] = vals.try_into().unwrap(); + let [l, r] = vals.try_into().map_err(|_| exception!(RUNTIME_EXCEPTION, "can only unzip over a set of pairs"))?; ll.push(l); lr.push(r); } -- cgit v1.2.3-freya