diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs
index 559ddd4b4e53..6332c1266e99 100644
--- a/mullvad-api/src/rest.rs
+++ b/mullvad-api/src/rest.rs
@@ -685,7 +685,7 @@ impl MullvadRestHandle {
}
match api_proxy.clone().get_api_addrs().await {
Ok(new_addrs) => {
- if let Some(addr) = new_addrs.get(0) {
+ if let Some(addr) = new_addrs.first() {
log::debug!(
"Fetched new API address {:?}. Fetching again in {} hours",
addr,
diff --git a/mullvad-daemon/src/access_method.rs b/mullvad-daemon/src/access_method.rs
index 7d9d3dba95d0..028e54f462bb 100644
--- a/mullvad-daemon/src/access_method.rs
+++ b/mullvad-daemon/src/access_method.rs
@@ -22,13 +22,13 @@ pub enum Error {
NoSuchMethod(access_method::Id),
/// Access method could not be rotate
#[error(display = "Access method could not be rotated")]
- RotationError,
+ RotationFailed,
/// Some error occured in the daemon's state of handling
/// [`AccessMethodSetting`]s & [`ApiConnectionMode`]s.
#[error(display = "Error occured when handling connection settings & details")]
ConnectionMode(#[error(source)] api::Error),
#[error(display = "API endpoint rotation failed")]
- RestError(#[error(source)] rest::Error),
+ Rest(#[error(source)] rest::Error),
/// Access methods settings error
#[error(display = "Settings error")]
Settings(#[error(source)] settings::Error),
@@ -190,7 +190,7 @@ where
.await
.map_err(|error| {
log::error!("Failed to rotate API endpoint: {}", error);
- Error::RotationError
+ Error::RotationFailed
})
}
@@ -261,7 +261,7 @@ pub async fn test_access_method(
.await
.map_err(|err| {
log::error!("Failed to rotate API endpoint: {err}");
- Error::RestError(err)
+ Error::Rest(err)
})?;
// Set up the reset
@@ -289,7 +289,7 @@ pub async fn test_access_method(
let result = mullvad_api::ApiProxy::new(rest_handle)
.api_addrs_available()
.await
- .map_err(Error::RestError)?;
+ .map_err(Error::Rest)?;
// We need to perform a rotation of API endpoint after a set action
// Note that this will be done automatically if the API call fails,
@@ -301,7 +301,7 @@ pub async fn test_access_method(
.await
.map_err(|err| {
log::error!("Failed to rotate API endpoint: {err}");
- Error::RestError(err)
+ Error::Rest(err)
})?;
}
diff --git a/mullvad-daemon/src/migrations/account_history.rs b/mullvad-daemon/src/migrations/account_history.rs
index d007c1414f3a..fb1691fb75c4 100644
--- a/mullvad-daemon/src/migrations/account_history.rs
+++ b/mullvad-daemon/src/migrations/account_history.rs
@@ -79,7 +79,7 @@ fn migrate_formats_inner(
} else if let Ok(token) = try_format_v1(account_bytes) {
Ok(token)
} else {
- Err(Error::ParseHistoryError)
+ Err(Error::ParseHistory)
}
}
@@ -110,7 +110,7 @@ fn try_format_v2(bytes: &[u8]) -> Result