From da2ef7fe4e2d718d3d1012cbb388888fbc0b8818 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 29 May 2024 08:12:30 +0900 Subject: [PATCH] dsl_util: use .ok() to drop unprintable error 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. --- lib/src/dsl_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/dsl_util.rs b/lib/src/dsl_util.rs index 89659e405..8e9f783f7 100644 --- a/lib/src/dsl_util.rs +++ b/lib/src/dsl_util.rs @@ -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();