From 3fb4b3dccf3d9e06a7cf1d8f68bc01ffa2256430 Mon Sep 17 00:00:00 2001 From: rascul Date: Fri, 15 Mar 2024 21:29:56 -0500 Subject: [PATCH] add ureq::Error behind feature flag --- Cargo.toml | 1 + src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ecccffe..080c69e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ keywords = ["error", "result"] [dependencies] serde_json = { version = "1.0", optional = true } +ureq = { version = "2.6", optional = true } [features] default = [] diff --git a/src/lib.rs b/src/lib.rs index 16335be..6ea5662 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,3 +69,10 @@ impl From for Rear { Self { message: error.to_string(), error: error.into() } } } + +#[cfg(feature = "ureq")] +impl From for Rear { + fn from(error: ureq::Error) -> Self { + Self { message: error.to_string(), error: error.into() } + } +}