Skip to content

Commit

Permalink
remove some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Apr 8, 2018
1 parent 9b12a2d commit be635f9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,14 +801,14 @@ macro_rules! permutation_iterator (
match $submac!($i, $($args)*) {
Ok((i,o)) => {
$i = i;
acc!($it, $res) = $crate::lib::std::option::Option::Some(o);
acc!($it, $res) = Some(o);
continue;
},
Err(Err::Error(_)) => {
$all_done = false;
},
Err(e) => {
$needed = $crate::lib::std::option::Option::Some(e);
$needed = Some(e);
break;
}
};
Expand Down
7 changes: 3 additions & 4 deletions src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,11 +1079,13 @@ macro_rules! length_bytes(
mod tests {
use internal::{Err, Needed};
use nom::{alpha, alphanumeric, digit, hex_digit, multispace, oct_digit, space};
use util::ErrorKind;
use types::{CompleteByteSlice, CompleteStr};
use util::ErrorKind;
#[cfg(feature = "alloc")]
#[cfg(feature = "verbose-errors")]
use lib::std::string::String;
#[cfg(feature = "alloc")]
#[cfg(feature = "verbose-errors")]
use lib::std::vec::Vec;

macro_rules! one_of (
Expand Down Expand Up @@ -1231,7 +1233,6 @@ mod tests {
#[cfg(feature = "alloc")]
#[test]
fn escaping_complete_str() {
use nom::alpha0;
named!(esc<CompleteStr, CompleteStr>, escaped!(call!(alpha), '\\', one_of!("\"n\\")));
assert_eq!(
esc(CompleteStr("abcd;")),
Expand Down Expand Up @@ -1322,8 +1323,6 @@ mod tests {
)))
);

let e = "è";
let a = "à";
named!(
esc2<String>,
map!(
Expand Down
15 changes: 7 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,35 +388,34 @@ pub mod lib {

#[cfg(feature = "std")]
pub mod std {
pub use std::{boxed, string, vec, cmp, convert, fmt, iter, mem,
ops, option, result, slice, str, collections, hash};
pub use std::{boxed, cmp, collections, convert, fmt, hash, iter, mem, ops, option, result, slice, str, string, vec};
pub mod prelude {
pub use std::prelude as v1;
}
}
}

pub use self::util::*;
pub use self::traits::*;
pub use self::util::*;

#[cfg(feature = "verbose-errors")]
pub use self::verbose_errors::*;

#[cfg(not(feature = "verbose-errors"))]
pub use self::simple_errors::*;

pub use self::branch::*;
pub use self::internal::*;
pub use self::macros::*;
pub use self::branch::*;
pub use self::sequence::*;
pub use self::multi::*;
pub use self::methods::*;
pub use self::multi::*;
pub use self::sequence::*;

pub use self::bytes::*;
pub use self::bits::*;
pub use self::bytes::*;

pub use self::nom::*;
pub use self::character::*;
pub use self::nom::*;

pub use self::whitespace::*;

Expand Down
1 change: 1 addition & 0 deletions src/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ mod tests {
use util::ErrorKind;
use nom::be_u16;
#[cfg(feature = "alloc")]
#[cfg(feature = "verbose-errors")]
use lib::std::vec::Vec;

// reproduce the tag and take macros, because of module import order
Expand Down
14 changes: 9 additions & 5 deletions src/types.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
//! Custom input types
//!
use traits::{AsBytes, AtEof, Compare, CompareResult, ExtendInto, FindSubstring, FindToken, InputIter, InputLength, InputTake, Offset,
ParseTo, Slice};
use traits::{AsBytes, AtEof, Compare, CompareResult, FindSubstring, FindToken, InputIter, InputLength, InputTake, Offset, ParseTo, Slice};

#[cfg(feature = "alloc")]
use traits::ExtendInto;

use lib::std::str::{self, CharIndices, Chars, FromStr};
use lib::std::ops::{Deref, Range, RangeFrom, RangeFull, RangeTo};
use lib::std::iter::{Enumerate, Map};
use lib::std::ops::{Deref, Range, RangeFrom, RangeFull, RangeTo};
use lib::std::slice::Iter;
use lib::std::str::{self, CharIndices, Chars, FromStr};
#[cfg(feature = "alloc")]
use lib::std::string::String;

/// Holds a complete String, for which the `at_eof` method always returns true
///
Expand Down Expand Up @@ -145,7 +149,7 @@ impl<'a> AsBytes for CompleteStr<'a> {
}
}

#[cfg(feature = "std")]
#[cfg(feature = "alloc")]
impl<'a> ExtendInto for CompleteStr<'a> {
type Item = char;
type Extender = String;
Expand Down
5 changes: 3 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#[cfg(feature = "verbose-errors")]
#[cfg(feature = "std")]
use internal::{Err, IResult};
#[cfg(feature = "verbose-errors")]
use verbose_errors::Context;

#[cfg(feature = "std")]
use std::collections::HashMap;

#[cfg(feature = "alloc")]
use lib::std::vec::Vec;
#[cfg(feature = "alloc")]
use lib::std::string::ToString;
#[cfg(feature = "alloc")]
use lib::std::vec::Vec;

#[cfg(feature = "std")]
pub trait HexDisplay {
Expand Down

0 comments on commit be635f9

Please sign in to comment.