Skip to content

Commit

Permalink
Add borrowing variant of CreateEmbedAuthor conversion (#3008)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 authored Nov 15, 2024
1 parent 7cf9921 commit 7f33394
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/builder/create_embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ impl From<User> for CreateEmbedAuthor {
}
}

#[cfg(feature = "model")]
impl From<&User> for CreateEmbedAuthor {
fn from(user: &User) -> Self {
let avatar_icon = user.face();
Self::new(user.name.clone()).icon_url(avatar_icon)
}
}

/// A builder to create the footer data for an embed. See [`CreateEmbed::footer`]
#[derive(Clone, Debug, Serialize)]
#[must_use]
Expand Down

0 comments on commit 7f33394

Please sign in to comment.