diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-29 21:05:10 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-29 21:05:10 -0500 |
commit | ace046624d2e23fba67564a86af7f03ed8a48eae (patch) | |
tree | 21ae64bc5897b1b89ee2ab8563b0e7ce047bf34a /matrix-std/src/iter.rs | |
parent | fix readme (diff) | |
download | matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.tar.gz matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.tar.bz2 matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.zip |
remove unwraps, fix utf8
Diffstat (limited to 'matrix-std/src/iter.rs')
-rw-r--r-- | matrix-std/src/iter.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<Value>) -> Result<Value> { 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); } |