use an into for new

master
rascul 1 year ago
parent 9a25b48b49
commit ea23831bc6

@ -27,7 +27,8 @@ impl Rear {
/// Create a new `Rear` from an error implementing `std::error::Error` with /// Create a new `Rear` from an error implementing `std::error::Error` with
/// a message from anything that implementes `Into<String>`. /// a message from anything that implementes `Into<String>`.
pub fn new<S: Into<String>>(error: Box<dyn Error>, message: S) -> Self { pub fn new<E: Into<Box<dyn Error>>, S: Into<String>>(error: E, message: S) -> Self {
let error = error.into();
let message = message.into(); let message = message.into();
Self { Self {

Loading…
Cancel
Save