Fix compiler warnings, clean up safety errors

This commit is contained in:
Cappy Ishihara 2024-06-02 01:01:57 +07:00
parent 5e4e1219b7
commit d7f04e7a9f
No known key found for this signature in database
GPG key ID: 50862C285CB76906
7 changed files with 53 additions and 70 deletions

View file

@ -107,7 +107,7 @@ pub async fn upload_avatar(
let mut file = BufWriter::new(fs::File::create(&avatar_file).await?);
io::copy(&mut request_data.as_ref(), &mut file).await?;
}
Ok(format!("ok"))
Ok("ok".to_string())
}
pub async fn equip_avatar(
@ -119,7 +119,7 @@ pub async fn equip_avatar(
if state.broadcasts.get(&uuid).unwrap().send(S2CMessage::Event(uuid).to_vec()).is_err() {
warn!("[WebSocket] Failed to send Event! Maybe there is no one to send") // FIXME: Засунуть в Handler
};
format!("ok")
"ok".to_string()
}
pub async fn delete_avatar(
@ -136,5 +136,5 @@ pub async fn delete_avatar(
fs::remove_file(avatar_file).await?;
}
// let avatar_file = format!("avatars/{}.moon",user_info.uuid);
Ok(format!("ok"))
Ok("ok".to_string())
}