Loosen up argument type on unexpected::Error::from
This commit is contained in:
parent
5f1f8ce1b7
commit
142fc14916
@ -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…
Reference in New Issue
Block a user