Skip to content

Commit

Permalink
dsl_util: use .ok() to drop unprintable error
Browse files Browse the repository at this point in the history
I used .map_err(|_: Vec<_>|) to clarify that the original data is returned as
an error (so it can't be .unwrap()-ed.) However, it can be said that the error
detail isn't important and .map_err() is too verbose.
  • Loading branch information
yuja committed May 29, 2024
1 parent cda477d commit d85a3b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/dsl_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<'i, T> FunctionCallNode<'i, T> {
optional.resize(M, None);
Ok((
required.try_into().unwrap(),
optional.try_into().map_err(|_: Vec<_>| ()).unwrap(),
optional.try_into().ok().unwrap(),
))
} else {
let (min, max) = count_range.into_inner();
Expand Down

0 comments on commit d85a3b7

Please sign in to comment.