Skip to content

Commit 240cf16

Browse files
committed
Replace .ok_or_else() with .unwrap()
1 parent 549dc30 commit 240cf16

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/base/value.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,12 +981,10 @@ impl BasicValue {
981981
let tag_id = obj_iter
982982
.next()
983983
.and_then(|value| value.as_u64().map(|num_u64| num_u64 as usize))
984-
.ok_or_else(|| anyhow::anyhow!("`tag_id` is not available in the value"))?;
984+
.unwrap();
985985

986986
// Take second element
987-
let value = obj_iter
988-
.next()
989-
.ok_or_else(|| anyhow::anyhow!("`value` is not available in the value"))?;
987+
let value = obj_iter.next().unwrap();
990988

991989
let cur_type = typ.types.get(tag_id)
992990
.ok_or_else(|| anyhow::anyhow!("No type in `tag_id` \"{tag_id}\" found"))?;

0 commit comments

Comments
 (0)