Use slices for outgoing raw bodies
This commit is contained in:
parent
d16fbe6fe6
commit
d71fa97346
@ -185,7 +185,7 @@ use ruma_identifiers::UserId;
|
||||
///
|
||||
/// request: {
|
||||
/// #[ruma_api(raw_body)]
|
||||
/// pub file: Vec<u8>,
|
||||
/// pub file: &'a [u8],
|
||||
/// }
|
||||
///
|
||||
/// response: {
|
||||
|
@ -111,7 +111,7 @@ pub mod newtype_raw_body_endpoint {
|
||||
|
||||
request: {
|
||||
#[ruma_api(raw_body)]
|
||||
pub file: Vec<u8>,
|
||||
pub file: &'a [u8],
|
||||
}
|
||||
|
||||
response: {
|
||||
|
@ -16,7 +16,7 @@ ruma_api! {
|
||||
request: {
|
||||
/// The file contents to upload.
|
||||
#[ruma_api(raw_body)]
|
||||
pub file: Vec<u8>,
|
||||
pub file: &'a [u8],
|
||||
|
||||
/// The name of the file being uploaded.
|
||||
#[ruma_api(query)]
|
||||
@ -48,7 +48,7 @@ ruma_api! {
|
||||
|
||||
impl<'a> Request<'a> {
|
||||
/// Creates a new `Request` with the given file contents.
|
||||
pub fn new(file: Vec<u8>) -> Self {
|
||||
pub fn new(file: &'a [u8]) -> Self {
|
||||
Self { file, filename: None, content_type: None }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user