Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Jun 17, 2019
1 parent 1aeea19 commit 60a34e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 6 additions & 10 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,13 @@ where
#[cfg(feature="alloc")]
pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::string::String {
use crate::{
lib::std::{
iter::repeat,
string::String,
vec::Vec
},
lib::std:: iter::repeat,
traits::Offset
};

let lines: Vec<_> = input.lines().map(String::from).collect();
let lines: crate::lib::std::vec::Vec<_> = input.lines().map(crate::lib::std::string::String::from).collect();

let mut result = String::new();
let mut result = crate::lib::std::string::String::new();

for (i, (substring, kind)) in e.errors.iter().enumerate() {
let mut offset = input.offset(substring);
Expand All @@ -178,7 +174,7 @@ pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::str
result += "\n";

if column > 0 {
result += &repeat(' ').take(column).collect::<String>();
result += &repeat(' ').take(column).collect::<crate::lib::std::string::String>();
}
result += "^\n";
result += &format!("expected '{}', found {}\n\n", c, substring.chars().next().unwrap());
Expand All @@ -188,7 +184,7 @@ pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::str
result += &lines[line];
result += "\n";
if column > 0 {
result += &repeat(' ').take(column).collect::<String>();
result += &repeat(' ').take(column).collect::<crate::lib::std::string::String>();
}
result += "^\n\n";
},
Expand All @@ -197,7 +193,7 @@ pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::str
result += &lines[line];
result += "\n";
if column > 0 {
result += &repeat(' ').take(column).collect::<String>();
result += &repeat(' ').take(column).collect::<crate::lib::std::string::String>();
}
result += "^\n\n";
}
Expand Down
2 changes: 0 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(feature = "alloc")]
use crate::lib::std::vec::Vec;
#[cfg(feature = "std")]
use crate::internal::IResult;
#[cfg(feature = "std")]
Expand Down

0 comments on commit 60a34e6

Please sign in to comment.