From 3eda99e9efbdfc2cb0e20932f20018d53baf5a64 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 17 Jul 2022 17:32:54 +0200 Subject: make the Clone bytes types Copy as well u8 arrays are copy, no need to not have our wrappers be copy. --- src/api/profile/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/api/profile') diff --git a/src/api/profile/mod.rs b/src/api/profile/mod.rs index 9abb872..ecfec12 100644 --- a/src/api/profile/mod.rs +++ b/src/api/profile/mod.rs @@ -290,8 +290,7 @@ pub(crate) async fn avatar_upload( sha.update(&data); let id = AvatarID(sha.finalize()[0..16].try_into().unwrap()); - db.set_user_avatar(&req.session, Avatar { id: id.clone(), data, content_type: ct.to_string() }) - .await?; + db.set_user_avatar(&req.session, Avatar { id, data, content_type: ct.to_string() }).await?; match db.get_devices(&req.session).await { Ok(devs) => defer.spawn_after_success("api::profile/avatar/upload(post)", { let (pc, db) = (Arc::clone(pc), db_pool.clone()); -- cgit v1.2.3