diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-10-30 00:49:56 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-10-30 00:49:56 -0300 |
commit | a66111d9f9c99f91d9256209b5e9a65e42cde7f5 (patch) | |
tree | aba85fd481ade96ba1be135c459af9d20eb409d7 /src/pattern.rs | |
parent | c1210b511af8ffada948550180360859b64009d2 (diff) |
Implement parser
Diffstat (limited to 'src/pattern.rs')
-rw-r--r-- | src/pattern.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pattern.rs b/src/pattern.rs index 2f7166a..6286ff9 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -56,8 +56,8 @@ impl<O: Serialize> Pattern<O> { ).deserialize(der)?; // this should always be None debug_assert!(obj.is_none()); - debug_assert!(packs.len() == 1); - let pack = packs.pop().unwrap(); + debug_assert!(packs.len() <= 1); + let pack = packs.pop().unwrap_or_else(Default::default); let de = De::deserialize(vm::Unpacker::new(pack, MAX_CALLS)); todo!() } |