Remove useless fn main() from documentation examples

This commit is contained in:
Sebastian Dröge 2021-11-18 14:52:03 +02:00
parent a5d8358379
commit 336f11e1ba

View file

@ -10,7 +10,6 @@
//! use nom::IResult;
//! use std::io::Read;
//!
//! fn main() {
//! let mut file = std::fs::File::open("playlist.m3u8").unwrap();
//! let mut bytes: Vec<u8> = Vec::new();
//! file.read_to_end(&mut bytes).unwrap();
@ -20,7 +19,6 @@
//! Result::Ok((i, Playlist::MediaPlaylist(pl))) => println!("Media playlist:\n{:?}", pl),
//! Result::Err(e) => panic!("Parsing error: \n{}", e),
//! }
//! }
//! ```
//!
//! Parsing a master playlist directly
@ -29,7 +27,6 @@
//! use std::io::Read;
//! use nom::IResult;
//!
//! fn main() {
//! let mut file = std::fs::File::open("masterplaylist.m3u8").unwrap();
//! let mut bytes: Vec<u8> = Vec::new();
//! file.read_to_end(&mut bytes).unwrap();
@ -37,8 +34,6 @@
//! if let Result::Ok((_, pl)) = m3u8_rs::parse_master_playlist(&bytes) {
//! println!("{:?}", pl);
//! }
//! }
//!
//! ```
//!
//! Creating a playlist and writing it back to a vec/file
@ -46,7 +41,6 @@
//! ```
//! use m3u8_rs::playlist::{MediaPlaylist, MediaPlaylistType, MediaSegment};
//!
//! fn main() {
//! let playlist = MediaPlaylist {
//! version: 6,
//! target_duration: 3.0,
@ -70,8 +64,6 @@
//!
//! //let mut file = std::fs::File::open("playlist.m3u8").unwrap();
//! //playlist.write_to(&mut file).unwrap();
//! }
//!
//! ```
use nom::branch::alt;