fix(primitives): skip nonempty invariant check (#506)
This commit is contained in:
parent
c8e8d2619c
commit
67f8b4bc9a
1 changed files with 8 additions and 8 deletions
|
|
@ -256,11 +256,11 @@ where
|
||||||
let items: Result<Vec<_>, _> = d.map_iter_with::<C, K, V>(ctx)?.collect();
|
let items: Result<Vec<_>, _> = d.map_iter_with::<C, K, V>(ctx)?.collect();
|
||||||
let items = items?;
|
let items = items?;
|
||||||
|
|
||||||
if items.is_empty() {
|
// if items.is_empty() {
|
||||||
return Err(Error::message(
|
// return Err(Error::message(
|
||||||
"decoding empty map as NonEmptyKeyValuePairs",
|
// "decoding empty map as NonEmptyKeyValuePairs",
|
||||||
));
|
// ));
|
||||||
}
|
// }
|
||||||
|
|
||||||
match datatype {
|
match datatype {
|
||||||
minicbor::data::Type::Map => Ok(NonEmptyKeyValuePairs::Def(items)),
|
minicbor::data::Type::Map => Ok(NonEmptyKeyValuePairs::Def(items)),
|
||||||
|
|
@ -771,9 +771,9 @@ where
|
||||||
|
|
||||||
let inner: Vec<T> = d.decode_with(ctx)?;
|
let inner: Vec<T> = d.decode_with(ctx)?;
|
||||||
|
|
||||||
if inner.is_empty() {
|
// if inner.is_empty() {
|
||||||
return Err(Error::message("decoding empty set as NonEmptySet"));
|
// return Err(Error::message("decoding empty set as NonEmptySet"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
Ok(Self(inner))
|
Ok(Self(inner))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue