summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2021-03-31 14:05:45 +0100
committerEmīls <emils@mullvad.net>2021-04-06 14:50:51 +0100
commitcf1d742bcf3a6358135a713e0707021c64c067a7 (patch)
tree4ed583af109c8f16aea87d1d85911bc540921de4
parentb07c517d8a6786857b8137c25aa20d46311a6acf (diff)
downloadmullvadvpn-cf1d742bcf3a6358135a713e0707021c64c067a7.tar.xz
mullvadvpn-cf1d742bcf3a6358135a713e0707021c64c067a7.zip
Import RPC error
-rw-r--r--mullvad-daemon/src/geoip.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/mullvad-daemon/src/geoip.rs b/mullvad-daemon/src/geoip.rs
index 1047d3bb15..d2d88987ec 100644
--- a/mullvad-daemon/src/geoip.rs
+++ b/mullvad-daemon/src/geoip.rs
@@ -1,5 +1,5 @@
use futures::join;
-use mullvad_rpc::{self, rest::RequestServiceHandle};
+use mullvad_rpc::{self, rest::{RequestServiceHandle, Error}};
use mullvad_types::location::{AmIMullvad, GeoIpLocation};
use talpid_types::ErrorExt;
@@ -8,16 +8,16 @@ const URI_V6: &str = "https://ipv6.am.i.mullvad.net/json";
pub async fn send_location_request(
request_sender: RequestServiceHandle,
-) -> Result<GeoIpLocation, mullvad_rpc::rest::Error> {
+) -> Result<GeoIpLocation, Error> {
let v4_sender = request_sender.clone();
let v4_future = async move {
let location = send_location_request_internal(URI_V4, v4_sender).await?;
- Ok::<GeoIpLocation, mullvad_rpc::rest::Error>(GeoIpLocation::from(location))
+ Ok::<GeoIpLocation, Error>(GeoIpLocation::from(location))
};
let v6_sender = request_sender.clone();
let v6_future = async move {
let location = send_location_request_internal(URI_V6, v6_sender).await?;
- Ok::<GeoIpLocation, mullvad_rpc::rest::Error>(GeoIpLocation::from(location))
+ Ok::<GeoIpLocation, Error>(GeoIpLocation::from(location))
};
let (v4_result, v6_result) = join!(v4_future, v6_future);
@@ -49,7 +49,7 @@ pub async fn send_location_request(
async fn send_location_request_internal(
uri: &'static str,
service: RequestServiceHandle,
-) -> Result<AmIMullvad, mullvad_rpc::rest::Error> {
+) -> Result<AmIMullvad, Error> {
let future_service = service.clone();
let request = mullvad_rpc::rest::RestRequest::get(uri)?;
let response = future_service.request(request).await?;