Resultify Message::get_filebytes()

This commit is contained in:
link2xt
2023-01-06 19:22:57 +00:00
parent 087b4289e5
commit 58ba107d01
8 changed files with 18 additions and 16 deletions

View File

@@ -1432,7 +1432,7 @@ fn recipients_contain_addr(recipients: &[(String, String)], addr: &str) -> bool
async fn is_file_size_okay(context: &Context, msg: &Message) -> Result<bool> {
match msg.param.get_path(Param::File, context)? {
Some(path) => {
let bytes = get_filebytes(context, &path).await;
let bytes = get_filebytes(context, &path).await?;
Ok(bytes <= UPPER_LIMIT_FILE_SIZE)
}
None => Ok(false),