Skip to content

Commit 09ebdbf

Browse files
committed
Error::with_msg to take impl Into<String>.
1 parent 3b2101f commit 09ebdbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/error.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ impl Error {
4040
}
4141

4242
#[must_use]
43-
pub fn with_msg(mut self, msg: String) -> Self {
43+
pub fn with_msg(mut self, msg: impl Into<String>) -> Self {
44+
let msg = msg.into();
4445
self.msg = if let Some(prev_msg) = self.msg {
4546
Some(format!("{msg}: {prev_msg}"))
4647
} else {

0 commit comments

Comments
 (0)