refactor: Let BlobObject::from_name() take &str (#6571)

This way, all the callers don't have to call to_string()
This commit is contained in:
Hocuri
2025-02-25 11:29:31 +01:00
committed by GitHub
parent 3df693a1bb
commit c5cf16f32a
4 changed files with 9 additions and 9 deletions

View File

@@ -1699,7 +1699,7 @@ async fn build_body_file(context: &Context, msg: &Message) -> Result<MimePart<'s
async fn build_avatar_file(context: &Context, path: &str) -> Result<String> {
let blob = match path.starts_with("$BLOBDIR/") {
true => BlobObject::from_name(context, path.to_string())?,
true => BlobObject::from_name(context, path)?,
false => BlobObject::from_path(context, path.as_ref())?,
};
let body = fs::read(blob.to_abs_path()).await?;