You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: message_delete.rs
    path of file: ./repos/backend/crates/delta/src/routes/channels
    
    the code of the file until where you have to start completion: use revolt_quark::{models::User, perms, Db, EmptyResponse, Error, Permission, Ref, Result};

/// # Delete Message
///
/// Delete a message you've sent or one you have permission to delete.
#[openapi(tag = "Messagin
    
pub async fn req(db: &Db, user: User, target: Ref, msg: Ref) -> Result<EmptyResponse> {
    let message = msg.as_message(db).await?;
    if message.channel != target.id {
        return Err(Error::NotFound);
    }

    if message.author != user.id {
        perms(&user)
            .channel(&target.as_channel(db).await?)
            .throw_permission(db, Permission::ManageMessages)
            .await?;
    }

    message.delete(db).await.map(|_| EmptyResponse)
}