/rust/registry/src/index.crates.io-6f17d22bba15001f/protobuf-3.2.0/src/rt/repeated.rs
Line | Count | Source (jump to first uncovered line) |
1 | | use crate::CodedInputStream; |
2 | | use crate::Enum; |
3 | | use crate::EnumOrUnknown; |
4 | | |
5 | | /// Read repeated enum field when the wire format is length-delimited. |
6 | 0 | pub fn read_repeated_packed_enum_or_unknown_into<E: Enum>( |
7 | 0 | is: &mut CodedInputStream, |
8 | 0 | target: &mut Vec<EnumOrUnknown<E>>, |
9 | 0 | ) -> crate::Result<()> { |
10 | 0 | let len = is.read_raw_varint64()?; |
11 | 0 | let old_limit = is.push_limit(len)?; |
12 | 0 | while !is.eof()? { |
13 | 0 | target.push(is.read_enum_or_unknown()?); |
14 | | } |
15 | 0 | is.pop_limit(old_limit); |
16 | 0 | Ok(()) |
17 | 0 | } |