diff --git a/src/error/unexpected.rs b/src/error/unexpected.rs index 71e82fc..28f4801 100644 --- a/src/error/unexpected.rs +++ b/src/error/unexpected.rs @@ -42,8 +42,11 @@ impl Error { return Error::from_displays(prefix, &e, e.source()); } - pub fn from(s: &str) -> Error { - Error::from_displays(None::, s, None::) + pub fn from(s: S) -> Error + where + S: AsRef, + { + Error::from_displays(None::, s.as_ref(), None::) } }