Migrate to Rust 2018

Cleans up some noise.
This commit is contained in:
Sebastian Dröge 2021-11-17 14:37:55 +02:00
parent 81398f86cd
commit 0ed0ce51f8
6 changed files with 10 additions and 31 deletions

View file

@ -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)." description = "A library for parsing m3u8 files (Apple's HTTP Live Streaming (HLS) protocol)."
documentation = "https://rutgersc.github.io/doc/m3u8_rs/index.html" documentation = "https://rutgersc.github.io/doc/m3u8_rs/index.html"
license = "MIT" license = "MIT"
edition = "2018"
[dependencies] [dependencies]
nom = { version = "7", optional = true } nom = { version = "7", optional = true }

View file

@ -12,12 +12,6 @@ To use this library, add the following dependency to `Cargo.toml`:
m3u8-rs = "1.0.6" 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) Also available on [crates.io](https://crates.io/crates/m3u8-rs)
# Documentation # Documentation

View file

@ -1,6 +1,3 @@
extern crate m3u8_rs;
extern crate nom;
use m3u8_rs::playlist::Playlist; use m3u8_rs::playlist::Playlist;
use std::io::Read; use std::io::Read;

View file

@ -1,6 +1,3 @@
extern crate m3u8_rs;
extern crate nom;
use m3u8_rs::playlist::Playlist; use m3u8_rs::playlist::Playlist;
use std::io::Read; use std::io::Read;

View file

@ -6,8 +6,6 @@
//! Parsing a playlist and let the parser figure out if it's a media or master playlist. //! 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 m3u8_rs::playlist::Playlist;
//! use nom::IResult; //! use nom::IResult;
//! use std::io::Read; //! use std::io::Read;
@ -28,8 +26,6 @@
//! Parsing a master playlist directly //! Parsing a master playlist directly
//! //!
//! ``` //! ```
//! extern crate nom;
//! extern crate m3u8_rs;
//! use std::io::Read; //! use std::io::Read;
//! use nom::IResult; //! use nom::IResult;
//! //!
@ -48,7 +44,6 @@
//! Creating a playlist and writing it back to a vec/file //! Creating a playlist and writing it back to a vec/file
//! //!
//! ``` //! ```
//! extern crate m3u8_rs;
//! use m3u8_rs::playlist::{MediaPlaylist, MediaPlaylistType, MediaSegment}; //! use m3u8_rs::playlist::{MediaPlaylist, MediaPlaylistType, MediaSegment};
//! //!
//! fn main() { //! fn main() {
@ -79,20 +74,18 @@
//! //!
//! ``` //! ```
extern crate nom;
pub mod playlist; pub mod playlist;
use self::nom::bytes::complete::{tag, take, is_not, is_a, take_while1, take_until}; use nom::bytes::complete::{tag, take, is_not, is_a, take_while1, take_until};
use self::nom::character::is_digit; use nom::character::is_digit;
use self::nom::character::complete::{digit1, multispace0, space0, line_ending, not_line_ending, char, none_of}; use nom::character::complete::{digit1, multispace0, space0, line_ending, not_line_ending, char, none_of};
use self::nom::sequence::{delimited, preceded, tuple, pair, terminated}; use nom::sequence::{delimited, preceded, tuple, pair, terminated};
use self::nom::combinator::{map, map_res, opt, peek, eof, complete}; use nom::combinator::{map, map_res, opt, peek, eof, complete};
use self::nom::multi::{fold_many0, many0}; use nom::multi::{fold_many0, many0};
use self::nom::branch::alt; use nom::branch::alt;
use self::nom::IResult; use nom::IResult;
use playlist::*; use crate::playlist::*;
use std::collections::HashMap; use std::collections::HashMap;
use std::f32; use std::f32;
use std::result::Result; use std::result::Result;

View file

@ -1,8 +1,5 @@
#![allow(unused_variables, unused_imports, dead_code)] #![allow(unused_variables, unused_imports, dead_code)]
extern crate m3u8_rs;
extern crate nom;
use m3u8_rs::playlist::*; use m3u8_rs::playlist::*;
use m3u8_rs::*; use m3u8_rs::*;
use nom::AsBytes; use nom::AsBytes;