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

main
Brian Picciano 4 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()); return Error::from_displays(prefix, &e, e.source());
} }
pub fn from(s: &str) -> Error { pub fn from<S>(s: S) -> Error
Error::from_displays(None::<String>, s, None::<String>) where
S: AsRef<str>,
{
Error::from_displays(None::<String>, s.as_ref(), None::<String>)
} }
} }

Loading…
Cancel
Save