don't automatically wrap in RumaResponse

This allows us to use the `ruma_route` convenience function even when we
need to add our own hacks into the responses, thus making us less
reliant on Ruma.
This commit is contained in:
Charles Hall 2024-05-18 18:31:36 -07:00
parent 87ac0e2a38
commit 230ebd3884
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
35 changed files with 438 additions and 405 deletions

View file

@ -2,7 +2,7 @@ use std::{collections::BTreeMap, iter::FromIterator};
use ruma::api::client::discovery::get_supported_versions;
use crate::{Result, Ruma};
use crate::{Result, Ruma, RumaResponse};
/// # `GET /_matrix/client/versions`
///
@ -18,7 +18,7 @@ use crate::{Result, Ruma};
/// should avoid using unstable features in their stable releases
pub(crate) async fn get_supported_versions_route(
_body: Ruma<get_supported_versions::Request>,
) -> Result<get_supported_versions::Response> {
) -> Result<RumaResponse<get_supported_versions::Response>> {
let resp = get_supported_versions::Response {
versions: vec![
"r0.5.0".to_owned(),
@ -35,5 +35,5 @@ pub(crate) async fn get_supported_versions_route(
)]),
};
Ok(resp)
Ok(RumaResponse(resp))
}