Consumes remaining array elements and the closing `]` when a visitor (e.g. for a tuple) stops reading before the end of the array.
(parser: &mut JsoncParser)
| 261 | /// Consumes remaining array elements and the closing `]` when a visitor |
| 262 | /// (e.g. for a tuple) stops reading before the end of the array. |
| 263 | fn drain_array(parser: &mut JsoncParser) -> Result<(), ParseError> { |
| 264 | loop { |
| 265 | match parser.scan_array_comma()? { |
| 266 | Some(Token::CloseBracket) => return Ok(()), |
| 267 | Some(token) => { |
| 268 | parser.put_back(token); |
| 269 | <::serde::de::IgnoredAny as ::serde::Deserialize>::deserialize(&mut *parser)?; |
| 270 | } |
| 271 | None => { |
| 272 | return Err( |
| 273 | parser |
| 274 | .scanner |
| 275 | .create_error_for_current_token(ParseErrorKind::UnterminatedArray), |
| 276 | ); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | struct ScannerSeqAccess<'a, 'b> { |
| 283 | parser: &'b mut JsoncParser<'a>, |
no test coverage detected
searching dependent graphs…