From ce0b21805c3e7949b87ef0dac477b20d28b50a79 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 26 Jul 2024 12:08:39 +0200 Subject: [PATCH] lang: deprecate io_err_other For regular error cases, `std::io::Error` can now also box errors and provides an `Error::other()` function since rust 1.74. For the case where it was used directly with strings (io_err_other("string")) -> that's what `io_format_err!()` and `io_bail!()` are for. Signed-off-by: Wolfgang Bumiller --- proxmox-lang/src/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/proxmox-lang/src/error.rs b/proxmox-lang/src/error.rs index 70d3d926..6dbefac6 100644 --- a/proxmox-lang/src/error.rs +++ b/proxmox-lang/src/error.rs @@ -6,6 +6,7 @@ use std::io; /// Helper to convert non-system-errors into an `io::Error` or `io::ErrorKind::Other`. /// /// A more convenient way is to use the `io_format_err!` macro. +#[deprecated = "use std::io::Error::other instead to box the original error"] pub fn io_err_other(e: E) -> io::Error { io::Error::new(std::io::ErrorKind::Other, e.to_string()) }