diff --git a/Cargo.toml b/Cargo.toml index c7335ca..e7c8668 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://github.com/rutgersc/m3u8-rs" description = "A library for parsing m3u8 files (Apple's HTTP Live Streaming (HLS) protocol)." documentation = "https://rutgersc.github.io/doc/m3u8_rs/index.html" license = "MIT" +edition = "2018" [dependencies] nom = { version = "7", optional = true } diff --git a/README.md b/README.md index 6001f2f..9e5f36d 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,6 @@ To use this library, add the following dependency to `Cargo.toml`: m3u8-rs = "1.0.6" ``` -And add the crate to `lib.rs` - -```rust -extern crate m3u8_rs; -``` - Also available on [crates.io](https://crates.io/crates/m3u8-rs) # Documentation diff --git a/examples/simple.rs b/examples/simple.rs index 3774d6b..7d53fc2 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,6 +1,3 @@ -extern crate m3u8_rs; -extern crate nom; - use m3u8_rs::playlist::Playlist; use std::io::Read; diff --git a/examples/with_nom_result.rs b/examples/with_nom_result.rs index cbe8d06..b795364 100644 --- a/examples/with_nom_result.rs +++ b/examples/with_nom_result.rs @@ -1,6 +1,3 @@ -extern crate m3u8_rs; -extern crate nom; - use m3u8_rs::playlist::Playlist; use std::io::Read; diff --git a/src/parser.rs b/src/parser.rs index 5b2f80c..0e67729 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -6,8 +6,6 @@ //! Parsing a playlist and let the parser figure out if it's a media or master playlist. //! //! ``` -//! extern crate nom; -//! extern crate m3u8_rs; //! use m3u8_rs::playlist::Playlist; //! use nom::IResult; //! use std::io::Read; @@ -28,8 +26,6 @@ //! Parsing a master playlist directly //! //! ``` -//! extern crate nom; -//! extern crate m3u8_rs; //! use std::io::Read; //! use nom::IResult; //! @@ -48,7 +44,6 @@ //! Creating a playlist and writing it back to a vec/file //! //! ``` -//! extern crate m3u8_rs; //! use m3u8_rs::playlist::{MediaPlaylist, MediaPlaylistType, MediaSegment}; //! //! fn main() { @@ -79,20 +74,18 @@ //! //! ``` -extern crate nom; - pub mod playlist; -use self::nom::bytes::complete::{tag, take, is_not, is_a, take_while1, take_until}; -use self::nom::character::is_digit; -use self::nom::character::complete::{digit1, multispace0, space0, line_ending, not_line_ending, char, none_of}; -use self::nom::sequence::{delimited, preceded, tuple, pair, terminated}; -use self::nom::combinator::{map, map_res, opt, peek, eof, complete}; -use self::nom::multi::{fold_many0, many0}; -use self::nom::branch::alt; +use nom::bytes::complete::{tag, take, is_not, is_a, take_while1, take_until}; +use nom::character::is_digit; +use nom::character::complete::{digit1, multispace0, space0, line_ending, not_line_ending, char, none_of}; +use nom::sequence::{delimited, preceded, tuple, pair, terminated}; +use nom::combinator::{map, map_res, opt, peek, eof, complete}; +use nom::multi::{fold_many0, many0}; +use nom::branch::alt; -use self::nom::IResult; -use playlist::*; +use nom::IResult; +use crate::playlist::*; use std::collections::HashMap; use std::f32; use std::result::Result; diff --git a/tests/lib.rs b/tests/lib.rs index 15df30f..02982bd 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,8 +1,5 @@ #![allow(unused_variables, unused_imports, dead_code)] -extern crate m3u8_rs; -extern crate nom; - use m3u8_rs::playlist::*; use m3u8_rs::*; use nom::AsBytes;