Skip to content
Permalink
Browse files

Clean up imports for bifrost-sdp

  • Loading branch information...
ZizhengTai committed Sep 14, 2019
1 parent 644bee8 commit b3f929fbb4969770f999d8fd13d8402965ef1e25
@@ -1,10 +1,8 @@
use crate::Parse;
use nom::{
bytes::complete::{is_not, tag},
character::complete::{line_ending, not_line_ending},
combinator::opt,
IResult,
};
use nom::bytes::complete::{is_not, tag};
use nom::character::complete::{line_ending, not_line_ending};
use nom::combinator::opt;
use nom::IResult;
use std::fmt;

/// A parsed attribute line, defined in
@@ -1,9 +1,8 @@
use crate::{util, Parse};
use nom::{
bytes::complete::tag,
character::complete::{alphanumeric1, line_ending},
IResult,
};
use crate::util;
use crate::Parse;
use nom::bytes::complete::tag;
use nom::character::complete::{alphanumeric1, line_ending};
use nom::IResult;
use std::fmt;

/// A parsed bandwidth line, defined in
@@ -1,5 +1,8 @@
use crate::{util, Parse};
use nom::{bytes::complete::tag, character::complete::line_ending, IResult};
use crate::util;
use crate::Parse;
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::IResult;
use std::fmt;

/// A parsed connection data line, defined in
@@ -1,5 +1,7 @@
use crate::{util, Parse};
use nom::{combinator::map, IResult};
use crate::util;
use crate::Parse;
use nom::combinator::map;
use nom::IResult;
use std::fmt;

/// A parsed email address line, defined in
@@ -1,12 +1,10 @@
use crate::Parse;
use http::Uri;
use nom::{
branch::alt,
bytes::complete::{is_not, tag},
character::complete::line_ending,
combinator::map_res,
IResult,
};
use nom::branch::alt;
use nom::bytes::complete::{is_not, tag};
use nom::character::complete::line_ending;
use nom::combinator::map_res;
use nom::IResult;
use std::fmt;

/// A parsed encryption key line, defined in
@@ -1,5 +1,7 @@
use crate::{util, Parse};
use nom::{combinator::map, IResult};
use crate::util;
use crate::Parse;
use nom::combinator::map;
use nom::IResult;
use std::fmt;

/// A parsed information line, defined in
@@ -23,26 +23,24 @@ mod version;
#[cfg(test)]
mod test_util;

pub use self::{
attribute::Attribute,
bandwidth::Bandwidth,
connection_data::ConnectionData,
email_address::EmailAddress,
encryption_key::EncryptionKey,
information::Information,
media_description::MediaDescription,
media_information::MediaInformation,
ntp::{Duration, Instant},
origin::Origin,
phone_number::PhoneNumber,
repeat_times::RepeatTimes,
session_description::SessionDescription,
session_name::SessionName,
time_description::TimeDescription,
time_zones::{TimeZone, TimeZones},
timing::Timing,
uri::Uri,
version::Version,
};
pub use self::attribute::Attribute;
pub use self::bandwidth::Bandwidth;
pub use self::connection_data::ConnectionData;
pub use self::email_address::EmailAddress;
pub use self::encryption_key::EncryptionKey;
pub use self::information::Information;
pub use self::media_description::MediaDescription;
pub use self::media_information::MediaInformation;
pub use self::ntp::{Duration, Instant};
pub use self::origin::Origin;
pub use self::phone_number::PhoneNumber;
pub use self::repeat_times::RepeatTimes;
pub use self::session_description::SessionDescription;
pub use self::session_name::SessionName;
pub use self::time_description::TimeDescription;
pub use self::time_zones::{TimeZone, TimeZones};
pub use self::timing::Timing;
pub use self::uri::Uri;
pub use self::version::Version;

use self::parse::Parse;
@@ -1,7 +1,9 @@
use crate::{util, Parse};
use nom::{
bytes::complete::tag, character::complete::line_ending, multi::separated_nonempty_list, IResult,
};
use crate::util;
use crate::Parse;
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::multi::separated_nonempty_list;
use nom::IResult;
use std::fmt;
use vec1::Vec1;

@@ -1,5 +1,7 @@
use crate::Parse;
use nom::{character::complete::digit1, combinator::map_res, IResult};
use nom::character::complete::digit1;
use nom::combinator::map_res;
use nom::IResult;

#[derive(Clone, Debug, PartialEq)]
pub struct Instant(u64);
@@ -1,5 +1,8 @@
use crate::{util, Parse};
use nom::{bytes::complete::tag, character::complete::line_ending, IResult};
use crate::util;
use crate::Parse;
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::IResult;
use std::fmt;

/// A parsed origin line, defined in
@@ -1,8 +1,6 @@
use nom::{
combinator::opt,
multi::{many0, many1},
IResult,
};
use nom::combinator::opt;
use nom::multi::{many0, many1};
use nom::IResult;
use vec1::Vec1;

pub trait Parse: Sized {
@@ -31,7 +29,10 @@ impl<T: Parse> Parse for Vec1<T> {
#[cfg(test)]
mod tests {
use super::*;
use nom::{bytes::complete::tag, character::complete::digit1, combinator::map_res};
use nom::bytes::complete::tag;
use nom::character::complete::digit1;
use nom::combinator::map_res;
use vec1::vec1;

#[derive(Debug, PartialEq)]
struct Test(i64);
@@ -75,8 +76,6 @@ mod tests {

#[test]
fn vec1() {
use vec1::vec1;

assert!(<Vec1<Test> as Parse>::parse("foo").is_err());
assert_eq!(
<Vec1<Test> as Parse>::parse("123.foo"),
@@ -1,5 +1,7 @@
use crate::{util, Parse};
use nom::{combinator::map, IResult};
use crate::util;
use crate::Parse;
use nom::combinator::map;
use nom::IResult;
use std::fmt;

/// A parsed phone number line, defined in
@@ -1,7 +1,8 @@
use crate::{Duration, Parse};
use nom::{
bytes::complete::tag, character::complete::line_ending, multi::separated_nonempty_list, IResult,
};
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::multi::separated_nonempty_list;
use nom::IResult;
use std::fmt;
use vec1::Vec1;

@@ -4,7 +4,8 @@ use crate::{
Version,
};
use nom::IResult;
use std::{fmt, str::FromStr};
use std::fmt;
use std::str::FromStr;
use vec1::Vec1;

/// A parsed SDP session description, defined in
@@ -122,10 +123,8 @@ impl FromStr for SessionDescription {
#[cfg(test)]
mod tests {
use super::*;
use crate::{
test_util::assert_parse_display, Duration, Instant, MediaInformation, RepeatTimes,
TimeZone, Timing,
};
use crate::test_util::assert_parse_display;
use crate::{Duration, Instant, MediaInformation, RepeatTimes, TimeZone, Timing};
use lazy_static::lazy_static;
use vec1::vec1;

@@ -1,5 +1,7 @@
use crate::{util, Parse};
use nom::{combinator::map, IResult};
use crate::util;
use crate::Parse;
use nom::combinator::map;
use nom::IResult;
use std::fmt;

/// A parsed session name line, defined in
@@ -37,10 +37,8 @@ impl Parse for TimeDescription {
#[cfg(test)]
mod tests {
use super::*;
use crate::{
test_util::{assert_err, assert_parse_display},
Duration, Instant,
};
use crate::test_util::{assert_err, assert_parse_display};
use crate::{Duration, Instant};
use vec1::vec1;

#[test]
@@ -1,7 +1,8 @@
use crate::{Duration, Instant, Parse};
use nom::{
bytes::complete::tag, character::complete::line_ending, multi::separated_nonempty_list, IResult,
};
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::multi::separated_nonempty_list;
use nom::IResult;
use std::fmt;
use vec1::Vec1;

@@ -1,5 +1,7 @@
use crate::{Instant, Parse};
use nom::{bytes::complete::tag, character::complete::line_ending, IResult};
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::IResult;
use std::fmt;

/// A parsed timing line, defined in
@@ -1,9 +1,8 @@
use crate::{util, Parse};
use crate::util;
use crate::Parse;
use http::Uri as HttpUri;
use nom::{
combinator::{map, map_res},
IResult,
};
use nom::combinator::{map, map_res};
use nom::IResult;
use std::fmt;

/// A parsed URI line, defined in
@@ -1,9 +1,7 @@
use nom::{
bytes::complete::{is_not, tag},
character::complete::line_ending,
combinator::{map, map_res},
IResult,
};
use nom::bytes::complete::{is_not, tag};
use nom::character::complete::line_ending;
use nom::combinator::{map, map_res};
use nom::IResult;
use std::str::FromStr;

/// Parses the input until a whitespace or a newline.
@@ -1,5 +1,7 @@
use crate::Parse;
use nom::{bytes::complete::tag, character::complete::line_ending, IResult};
use nom::bytes::complete::tag;
use nom::character::complete::line_ending;
use nom::IResult;
use std::fmt;

/// A parsed protocal version line, defined in

0 comments on commit b3f929f

Please sign in to comment.
You can’t perform that action at this time.