Skip to content

Commit

Permalink
convert_error should accept a type that derefs to &str
Browse files Browse the repository at this point in the history
this will allow other input types like nom_locate
  • Loading branch information
Geal committed Aug 30, 2020
1 parent 42248ee commit b2ed755
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/error.rs
Expand Up @@ -234,7 +234,8 @@ where

/// Transforms a `VerboseError` into a trace with input position information
#[cfg(feature = "alloc")]
pub fn convert_error(input: &str, e: VerboseError<&str>) -> crate::lib::std::string::String {
pub fn convert_error<I: core::ops::Deref<Target = str>>(input: I, e: VerboseError<I>)
-> crate::lib::std::string::String {
use crate::lib::std::fmt::Write;
use crate::traits::Offset;

Expand Down

0 comments on commit b2ed755

Please sign in to comment.