From ea23831bc654ca882a474efe995d08eeab69ea24 Mon Sep 17 00:00:00 2001 From: rascul Date: Tue, 5 Sep 2023 17:55:21 -0500 Subject: [PATCH] use an into for new --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 317a4e5..064e8ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,8 @@ impl Rear { /// Create a new `Rear` from an error implementing `std::error::Error` with /// a message from anything that implementes `Into`. - pub fn new>(error: Box, message: S) -> Self { + pub fn new>, S: Into>(error: E, message: S) -> Self { + let error = error.into(); let message = message.into(); Self {