replace ErrorKind::Forbidden with forbidden() non-exhaustive constructor

917584e0ca

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-03 15:59:03 -04:00 committed by June
parent 13cd9c4c38
commit ddcf43f1b8
21 changed files with 75 additions and 73 deletions

View file

@ -89,7 +89,7 @@ pub async fn register_route(body: Ruma<register::v3::Request>) -> Result<registe
{:?}",
body.username
);
return Err(Error::BadRequest(ErrorKind::Forbidden, "Registration has been disabled."));
return Err(Error::BadRequest(ErrorKind::forbidden(), "Registration has been disabled."));
}
if body.body.login_type == Some(LoginType::ApplicationService) && !body.from_appservice {
@ -121,7 +121,7 @@ pub async fn register_route(body: Ruma<register::v3::Request>) -> Result<registe
registration. Guest's initial device name: {:?}",
body.initial_device_display_name
);
return Err(Error::BadRequest(ErrorKind::Forbidden, "Registration temporarily disabled."));
return Err(Error::BadRequest(ErrorKind::forbidden(), "Registration temporarily disabled."));
}
let user_id = match (&body.username, is_guest) {