From 60a34e60ffb570b6eef4a044d44de8d5ba6f67f1 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Mon, 17 Jun 2019 15:07:56 +0200 Subject: [PATCH] fix some warnings --- src/error.rs | 16 ++++++---------- src/util.rs | 2 -- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/error.rs b/src/error.rs index 7d376546b..891d071ac 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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); @@ -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::(); + result += &repeat(' ').take(column).collect::(); } result += "^\n"; result += &format!("expected '{}', found {}\n\n", c, substring.chars().next().unwrap()); @@ -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::(); + result += &repeat(' ').take(column).collect::(); } result += "^\n\n"; }, @@ -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::(); + result += &repeat(' ').take(column).collect::(); } result += "^\n\n"; } diff --git a/src/util.rs b/src/util.rs index 2cec40f42..488bbfb7d 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,5 +1,3 @@ -#[cfg(feature = "alloc")] -use crate::lib::std::vec::Vec; #[cfg(feature = "std")] use crate::internal::IResult; #[cfg(feature = "std")]