Simplify Optional Syntax

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
This commit is contained in:
Hunter Harloff
2024-03-31 19:59:48 -04:00
committed by Jeong YunWon
parent f6569313d7
commit c5550cd466

View File

@@ -1986,10 +1986,7 @@ mod decl {
return Err(vm.new_value_error("n must be at least one".to_owned()));
}
let n = n.to_usize().unwrap();
let iterable = match iterable_ref.get_iter(vm) {
Ok(it) => it,
Err(e) => return Err(e),
};
let iterable = iterable_ref.get_iter(vm)?;
Self {
iterable,