client-api: Use Request::new() in Request::from_url() for get_content_as_filename

This commit is contained in:
Kévin Commaille 2023-05-04 11:58:23 +02:00 committed by Kévin Commaille
parent 67019c7f48
commit f3ba40a56f

View File

@ -90,12 +90,7 @@ pub mod v3 {
pub fn from_url(url: &MxcUri, filename: String) -> Result<Self, IdParseError> { pub fn from_url(url: &MxcUri, filename: String) -> Result<Self, IdParseError> {
let (server_name, media_id) = url.parts()?; let (server_name, media_id) = url.parts()?;
Ok(Self { Ok(Self::new(media_id.to_owned(), server_name.to_owned(), filename))
media_id: media_id.to_owned(),
server_name: server_name.to_owned(),
filename,
allow_remote: true,
})
} }
} }