Skip to content

Commit 30905ea

Browse files
committed
ref: Rename
1 parent f0fdc11 commit 30905ea

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

relay-server/src/endpoints/attachments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use serde::Deserialize;
77

88
use crate::endpoints::common::{self, BadStoreRequest};
99
use crate::envelope::{AttachmentType, Envelope};
10-
use crate::extractors::{RequestMeta, Xt};
10+
use crate::extractors::{Extractor, RequestMeta};
1111
use crate::service::ServiceState;
1212
use crate::utils;
1313

@@ -35,7 +35,7 @@ pub async fn handle(
3535
state: ServiceState,
3636
meta: RequestMeta,
3737
Path(path): Path<AttachmentPath>,
38-
Xt(multipart): Xt<Multipart<'static>>,
38+
Extractor(multipart): Extractor<Multipart<'static>>,
3939
) -> Result<impl IntoResponse, BadStoreRequest> {
4040
let envelope = extract_envelope(meta, path, multipart).await?;
4141
common::handle_envelope(&state, envelope).await?;

relay-server/src/endpoints/minidump.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use relay_event_schema::protocol::EventId;
1212
use crate::constants::{ITEM_NAME_BREADCRUMBS1, ITEM_NAME_BREADCRUMBS2, ITEM_NAME_EVENT};
1313
use crate::endpoints::common::{self, BadStoreRequest, TextResponse};
1414
use crate::envelope::{AttachmentType, ContentType, Envelope, Item, ItemType};
15-
use crate::extractors::{RawContentType, RequestMeta, Xt};
15+
use crate::extractors::{Extractor, RawContentType, RequestMeta};
1616
use crate::service::ServiceState;
1717
use crate::utils;
1818

@@ -137,7 +137,7 @@ async fn handle(
137137
let envelope = if MINIDUMP_RAW_CONTENT_TYPES.contains(&content_type.as_ref()) {
138138
extract_raw_minidump(request.extract().await?, meta)?
139139
} else {
140-
let Xt(multipart) = request.extract_with_state(&state).await?;
140+
let Extractor(multipart) = request.extract_with_state(&state).await?;
141141
extract_multipart(multipart, meta).await?
142142
};
143143

relay-server/src/extractors/remote.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use multer::Multipart;
88
use crate::service::ServiceState;
99
use crate::utils::{self, ApiErrorResponse};
1010

11-
/// A transparent wrapper around a type that implements [`FromRequest`] or [`IntoResponse`].
11+
/// A transparent wrapper around a remote type that implements [`FromRequest`] or [`IntoResponse`].
1212
///
1313
/// # Example
1414
///
@@ -18,45 +18,45 @@ use crate::utils::{self, ApiErrorResponse};
1818
/// use axum::extract::{FromRequest, Request};
1919
/// use axum::response::IntoResponse;
2020
///
21-
/// use crate::extractors::Xt;
21+
/// use crate::extractors::Remote;
2222
///
2323
/// // Derive `FromRequest` for `bool` for illustration purposes:
2424
/// #[axum::async_trait]
25-
/// impl<S> axum::extract::FromRequest<S> for Xt<bool> {
26-
/// type Rejection = Xt<Infallible>;
25+
/// impl<S> axum::extract::FromRequest<S> for Remote<bool> {
26+
/// type Rejection = Remote<Infallible>;
2727
///
2828
/// async fn from_request(request: Request) -> Result<Self, Self::Rejection> {
29-
/// Ok(Xt(true))
29+
/// Ok(Remote(true))
3030
/// }
3131
/// }
3232
///
33-
/// impl IntoResponse for Xt<Infallible> {
33+
/// impl IntoResponse for Remote<Infallible> {
3434
/// fn into_response(self) -> axum::response::Response {
3535
/// match self.0 {}
3636
/// }
3737
/// }
3838
/// ```
3939
#[derive(Debug)]
40-
pub struct Xt<T>(pub T);
40+
pub struct Remote<T>(pub T);
4141

42-
impl<T> From<T> for Xt<T> {
42+
impl<T> From<T> for Remote<T> {
4343
fn from(inner: T) -> Self {
4444
Self(inner)
4545
}
4646
}
4747

4848
#[axum::async_trait]
49-
impl FromRequest<ServiceState> for Xt<Multipart<'static>> {
50-
type Rejection = Xt<multer::Error>;
49+
impl FromRequest<ServiceState> for Remote<Multipart<'static>> {
50+
type Rejection = Remote<multer::Error>;
5151

5252
async fn from_request(request: Request, state: &ServiceState) -> Result<Self, Self::Rejection> {
5353
utils::multipart_from_request(request, state.config())
54-
.map(Xt)
55-
.map_err(Xt)
54+
.map(Remote)
55+
.map_err(Remote)
5656
}
5757
}
5858

59-
impl IntoResponse for Xt<multer::Error> {
59+
impl IntoResponse for Remote<multer::Error> {
6060
fn into_response(self) -> Response {
6161
let Self(ref error) = self;
6262

0 commit comments

Comments
 (0)