summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mullvad-api/src/rest.rs7
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)