Skip to content

Commit 9944eee

Browse files
committed
chore: Use async_trait::async_trait instead of axum::async_trait to prepare migration to Axum 0.8
1 parent f91984c commit 9944eee

25 files changed

+28
-29
lines changed

crates/rest-api/src/features/auth/guards/auth_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use crate::guards::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::auth::AuthService {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/features/auth/guards/auth_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::guards::prelude::*;
1010

1111
const PREFIX: &'static str = "Bearer ";
1212

13-
#[axum::async_trait]
13+
#[async_trait::async_trait]
1414
impl FromRequestParts<AppState> for service::auth::auth_service::AuthToken {
1515
type Rejection = error::Error;
1616

crates/rest-api/src/features/auth/guards/authenticated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use crate::guards::prelude::*;
5151
/// [`MemberService`]: service::members::MemberService
5252
pub struct Authenticated;
5353

54-
#[axum::async_trait]
54+
#[async_trait::async_trait]
5555
impl FromRequestParts<AppState> for Authenticated {
5656
type Rejection = error::Error;
5757

crates/rest-api/src/features/auth/guards/basic_auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct BasicAuth {
1717
pub password: SecretString,
1818
}
1919

20-
#[axum::async_trait]
20+
#[async_trait::async_trait]
2121
impl FromRequestParts<AppState> for BasicAuth {
2222
type Rejection = error::Error;
2323

crates/rest-api/src/features/auth/guards/is_admin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::guards::prelude::*;
1313
/// but it'll do for now.
1414
pub struct IsAdmin;
1515

16-
#[axum::async_trait]
16+
#[async_trait::async_trait]
1717
impl FromRequestParts<AppState> for IsAdmin {
1818
type Rejection = error::Error;
1919

crates/rest-api/src/features/auth/guards/user_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use service::auth::auth_service::AuthToken;
77

88
use crate::guards::prelude::*;
99

10-
#[axum::async_trait]
10+
#[async_trait::async_trait]
1111
impl FromRequestParts<AppState> for service::auth::UserInfo {
1212
type Rejection = error::Error;
1313

crates/rest-api/src/features/init/guards/init_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use crate::guards::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::init::InitService {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/features/invitations/guards/invitation_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use service::members::UnauthenticatedMemberService;
77

88
use crate::guards::prelude::*;
99

10-
#[axum::async_trait]
10+
#[async_trait::async_trait]
1111
impl FromRequestParts<AppState> for service::invitations::InvitationService {
1212
type Rejection = Infallible;
1313

crates/rest-api/src/features/members/guards/member_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use service::xmpp::XmppService;
77

88
use crate::guards::prelude::*;
99

10-
#[axum::async_trait]
10+
#[async_trait::async_trait]
1111
impl FromRequestParts<AppState> for service::members::MemberService {
1212
type Rejection = error::Error;
1313

crates/rest-api/src/features/members/guards/unauthenticated_member_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use crate::guards::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::members::UnauthenticatedMemberService {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/features/network_checks/guards/network_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use service::network_checks::NetworkChecker;
77

88
use crate::guards::prelude::*;
99

10-
#[axum::async_trait]
10+
#[async_trait::async_trait]
1111
impl FromRequestParts<AppState> for NetworkChecker {
1212
type Rejection = Infallible;
1313

crates/rest-api/src/features/workspace_details/guards/workspace_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use service::{
1010

1111
use crate::{error::prelude::*, guards::prelude::*};
1212

13-
#[axum::async_trait]
13+
#[async_trait::async_trait]
1414
impl FromRequestParts<AppState> for WorkspaceService {
1515
type Rejection = error::Error;
1616

crates/rest-api/src/forms/qs_query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn rename_repeated_query_param_names_(query: &str) -> String {
7474
new_query
7575
}
7676

77-
#[axum::async_trait]
77+
#[async_trait::async_trait]
7878
impl<T, S> FromRequestParts<S> for QsQuery<T>
7979
where
8080
T: serde::de::DeserializeOwned + Send,
@@ -107,7 +107,7 @@ where
107107
}
108108
}
109109

110-
// #[axum::async_trait]
110+
// #[async_trait::async_trait]
111111
// impl<T, S> FromRequestParts<S> for StrictQsQuery<T>
112112
// where
113113
// T: serde::de::DeserializeOwned,

crates/rest-api/src/forms/strict_qs_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<T: std::fmt::Debug> std::fmt::Debug for QsQuery<T> {
6868
}
6969
}
7070

71-
#[axum::async_trait]
71+
#[async_trait::async_trait]
7272
impl<T, S> FromRequestParts<S> for QsQuery<T>
7373
where
7474
T: serde::de::DeserializeOwned,

crates/rest-api/src/guards/app_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use super::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::AppConfig {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/guards/notifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use super::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::notifications::Notifier {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/guards/pod_network_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::features::init::PodAddressNotInitialized;
1212

1313
use super::prelude::*;
1414

15-
#[axum::async_trait]
15+
#[async_trait::async_trait]
1616
impl FromRequestParts<AppState> for service::network_checks::PodNetworkConfig {
1717
type Rejection = error::Error;
1818

crates/rest-api/src/guards/secrets_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use super::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::secrets::SecretsStore {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/guards/server_config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::features::init::ServerConfigNotInitialized;
99

1010
use super::prelude::*;
1111

12-
#[axum::async_trait]
12+
#[async_trait::async_trait]
1313
impl FromRequestParts<AppState> for server_config::Model {
1414
type Rejection = error::Error;
1515

@@ -24,7 +24,7 @@ impl FromRequestParts<AppState> for server_config::Model {
2424
}
2525
}
2626

27-
#[axum::async_trait]
27+
#[async_trait::async_trait]
2828
impl FromRequestParts<AppState> for service::server_config::ServerConfig {
2929
type Rejection = error::Error;
3030

crates/rest-api/src/guards/server_ctl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use super::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::xmpp::ServerCtl {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/guards/server_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use service::server_config::entities::server_config;
77

88
use super::prelude::*;
99

10-
#[axum::async_trait]
10+
#[async_trait::async_trait]
1111
impl FromRequestParts<AppState> for service::xmpp::ServerManager {
1212
type Rejection = error::Error;
1313

crates/rest-api/src/guards/uuid_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use super::prelude::*;
77

8-
#[axum::async_trait]
8+
#[async_trait::async_trait]
99
impl FromRequestParts<AppState> for service::dependencies::Uuid {
1010
type Rejection = Infallible;
1111

crates/rest-api/src/guards/xmpp_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use service::{
1010

1111
use super::prelude::*;
1212

13-
#[axum::async_trait]
13+
#[async_trait::async_trait]
1414
impl FromRequestParts<AppState> for XmppService {
1515
type Rejection = error::Error;
1616

@@ -29,7 +29,7 @@ impl FromRequestParts<AppState> for XmppService {
2929
}
3030
}
3131

32-
#[axum::async_trait]
32+
#[async_trait::async_trait]
3333
impl FromRequestParts<AppState> for XmppServiceInner {
3434
type Rejection = Infallible;
3535

crates/rest-api/src/util/content_type_or.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use std::marker::PhantomData;
55

66
use axum::{
7-
async_trait,
87
extract::FromRequestParts,
98
http::{header::ACCEPT, request::Parts, StatusCode},
109
response::{IntoResponse, Response},
@@ -76,7 +75,7 @@ where
7675

7776
pub struct WithContentType<C>(PhantomData<C>);
7877

79-
#[async_trait]
78+
#[async_trait::async_trait]
8079
impl<S, C> FromRequestParts<S> for WithContentType<C>
8180
where
8281
C: ContentType,

crates/rest-api/tests/prelude/mocks/mock_network_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl MockNetworkChecker {
5757
}
5858
}
5959

60-
#[axum::async_trait]
60+
#[async_trait::async_trait]
6161
impl NetworkCheckerImpl for MockNetworkChecker {
6262
async fn ipv4_lookup(&self, domain: &str) -> Result<Vec<DnsRecord>, DnsLookupError> {
6363
self.lookup_(domain, DnsRecordDiscriminants::A)

0 commit comments

Comments
 (0)