1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-06-07 07:59:21 +00:00
hls_m3u8/examples/parse.rs
2018-02-11 15:10:52 +09:00

19 lines
408 B
Rust

extern crate hls_m3u8;
#[macro_use]
extern crate trackable;
use std::io::{self, Read};
use trackable::error::Failure;
fn main() {
let mut m3u8 = String::new();
track_try_unwrap!(
io::stdin()
.read_to_string(&mut m3u8)
.map_err(Failure::from_error)
);
for line in hls_m3u8::line::Lines::new(&m3u8) {
println!("{:?}", track_try_unwrap!(line));
}
}