rename RumaResponse to Ra

It's very commonly used so having a short name is worthwhile, I think.
This commit is contained in:
Charles Hall 2024-05-18 18:59:46 -07:00
parent 230ebd3884
commit 7ea98dac72
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
38 changed files with 332 additions and 351 deletions

View file

@ -11,7 +11,7 @@ use ruma::{
use thiserror::Error;
use tracing::{error, info};
use crate::RumaResponse;
use crate::Ra;
pub(crate) type Result<T, E = Error> = std::result::Result<T, E>;
@ -95,7 +95,7 @@ impl Error {
Self::BadConfig(message)
}
pub(crate) fn to_response(&self) -> RumaResponse<UiaaResponse> {
pub(crate) fn to_response(&self) -> Ra<UiaaResponse> {
use ErrorKind::{
Forbidden, GuestAccessForbidden, LimitExceeded, MissingToken,
NotFound, ThreepidAuthFailed, ThreepidDenied, TooLarge,
@ -104,7 +104,7 @@ impl Error {
};
if let Self::Uiaa(uiaainfo) = self {
return RumaResponse(UiaaResponse::AuthResponse(uiaainfo.clone()));
return Ra(UiaaResponse::AuthResponse(uiaainfo.clone()));
}
if let Self::Federation(origin, error) = self {
@ -113,7 +113,7 @@ impl Error {
kind: Unknown,
message: format!("Answer from {origin}: {error}"),
};
return RumaResponse(UiaaResponse::MatrixError(error));
return Ra(UiaaResponse::MatrixError(error));
}
let message = format!("{self}");
@ -149,7 +149,7 @@ impl Error {
info!("Returning an error: {}: {}", status_code, message);
RumaResponse(UiaaResponse::MatrixError(RumaError {
Ra(UiaaResponse::MatrixError(RumaError {
body: ErrorBody::Standard {
kind,
message,