diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-10-01 11:20:21 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-10-16 09:56:51 +0200 |
| commit | 3aa952b3a6ecaffa5dc5c70f2435c2d297d8d2ef (patch) | |
| tree | efd452bdb249018e4059f8e309f5756c1d58dcb6 /mullvad-api/src | |
| parent | ae1c1cefb5c048fcec021397a85ad886197913f7 (diff) | |
| download | mullvadvpn-3aa952b3a6ecaffa5dc5c70f2435c2d297d8d2ef.tar.xz mullvadvpn-3aa952b3a6ecaffa5dc5c70f2435c2d297d8d2ef.zip | |
Add `impl From<Infallible> for Error`
Diffstat (limited to 'mullvad-api/src')
| -rw-r--r-- | mullvad-api/src/rest.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs index 0a2bed93b7..058fabd8ab 100644 --- a/mullvad-api/src/rest.rs +++ b/mullvad-api/src/rest.rs @@ -22,6 +22,7 @@ use hyper::{ use mullvad_types::account::AccountNumber; use std::{ borrow::Cow, + convert::Infallible, error::Error as StdError, str::FromStr, sync::{Arc, Weak}, @@ -72,6 +73,12 @@ pub enum Error { NoAccessTokenStore, } +impl From<Infallible> for Error { + fn from(_: Infallible) -> Self { + unreachable!() + } +} + impl Error { pub fn is_network_error(&self) -> bool { matches!(self, Error::HyperError(_) | Error::TimeoutError) |
