| 590 | |
| 591 | #[inline] |
| 592 | fn visit_seq<A: SeqAccess<'de>>(self, mut seq: A) -> Result<Self::Value, A::Error> { |
| 593 | let _version_marker = match seq.next_element()? { |
| 594 | Some(val) => val, |
| 595 | None => { |
| 596 | return Err(Error::invalid_length( |
| 597 | 0usize, |
| 598 | &"struct ModuleDeclarations with 4 elements", |
| 599 | )); |
| 600 | } |
| 601 | }; |
| 602 | let functions = match seq.next_element()? { |
| 603 | Some(val) => val, |
| 604 | None => { |
| 605 | return Err(Error::invalid_length( |
| 606 | 2usize, |
| 607 | &"struct ModuleDeclarations with 4 elements", |
| 608 | )); |
| 609 | } |
| 610 | }; |
| 611 | let data_objects = match seq.next_element()? { |
| 612 | Some(val) => val, |
| 613 | None => { |
| 614 | return Err(Error::invalid_length( |
| 615 | 3usize, |
| 616 | &"struct ModuleDeclarations with 4 elements", |
| 617 | )); |
| 618 | } |
| 619 | }; |
| 620 | let names = get_names(&functions, &data_objects)?; |
| 621 | Ok(ModuleDeclarations { |
| 622 | _version_marker, |
| 623 | names, |
| 624 | functions, |
| 625 | data_objects, |
| 626 | }) |
| 627 | } |
| 628 | |
| 629 | #[inline] |
| 630 | fn visit_map<A: MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> { |