refactor: use <_> instead of <_parameter_name>

This commit is contained in:
timokoesters 2020-07-27 17:36:54 +02:00
parent cc411c530b
commit 489cbc0a93
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
7 changed files with 407 additions and 403 deletions

View file

@ -13,7 +13,7 @@ use {
http::Status,
response::{self, Responder},
tokio::io::AsyncReadExt,
Outcome::*,
outcome::Outcome::*,
Request, State,
},
ruma::api::Endpoint,
@ -24,7 +24,7 @@ use {
/// first.
pub struct Ruma<T> {
pub body: T,
pub user_id: Option<UserId>,
pub sender_id: Option<UserId>,
pub device_id: Option<Box<DeviceId>>,
pub json_body: Option<Box<serde_json::value::RawValue>>, // This is None when body is not a valid string
}
@ -94,7 +94,7 @@ impl<'a, T: Endpoint> FromTransformedData<'a> for Ruma<T> {
match T::try_from(http_request) {
Ok(t) => Success(Ruma {
body: t,
user_id,
sender_id: user_id,
device_id,
// TODO: Can we avoid parsing it again? (We only need this for append_pdu)
json_body: utils::string_from_bytes(&body)