From 677027e22c7d94ee12d4a5a0ac0c9185e4dd1497 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Thu, 14 Oct 2021 21:35:35 +0200 Subject: [PATCH] Update readme with new attribute --- README.md | 7 +++++-- src/playlist.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c62075..a4ff161 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ match parsed { } ``` -Currently the parser will succeed even if REQUIRED attributes/tags are missing from a playlist (such as the `#EXT-X-VERSION` tag). +Currently, the parser will succeed even if REQUIRED attributes/tags are missing from a playlist (such as the `#EXT-X-VERSION` tag). The option to abort parsing when attributes/tags are missing may be something to add later on. # Structure Summary -All of the details about the structs are taken from https://tools.ietf.org/html/draft-pantos-http-live-streaming-19. +All the details about the structs are taken from https://tools.ietf.org/html/draft-pantos-http-live-streaming-19. ```rust @@ -91,6 +91,8 @@ pub struct MasterPlaylist { pub session_key: Option, pub start: Option, pub independent_segments: bool, + pub alternatives: Vec, + pub unknown_tags: Vec, } pub struct MediaPlaylist { @@ -131,6 +133,7 @@ pub struct MediaSegment { pub map: Option, pub program_date_time: Option, pub daterange: Option, + pub unknown_tags: Vec, } ``` diff --git a/src/playlist.rs b/src/playlist.rs index a1c71d0..9bd2f17 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -715,7 +715,7 @@ mod test { }; let mut output = Vec::new(); - write!(output, "{}", cue_out_tag); + write!(output, "{}", cue_out_tag).unwrap(); assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-OUT:DURATION=30") } @@ -728,7 +728,7 @@ mod test { }; let mut output = Vec::new(); - write!(output, "{}", cue_in_tag); + write!(output, "{}", cue_in_tag).unwrap(); assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-IN") }