Loosen up argument type on unexpected::Error::from

main
Brian Picciano 3 months ago
parent 5f1f8ce1b7
commit 142fc14916
  1. 7
      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::<String>, s, None::<String>)
pub fn from<S>(s: S) -> Error
where
S: AsRef<str>,
{
Error::from_displays(None::<String>, s.as_ref(), None::<String>)
}
}

Loading…
Cancel
Save