Skip to content

Commit

Permalink
Add CreateEmbed::into_inner for getting the wrapped Embed (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Calum4 authored Jun 5, 2024
1 parent c657117 commit 8c84b4f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/builder/create_embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ impl CreateEmbed {
super::check_overflow(length, crate::constants::EMBED_MAX_LENGTH)
.map_err(|overflow| Error::Model(ModelError::EmbedTooLarge(overflow)))
}

/// Consumes the [`CreateEmbed`], returning the wrapped [`Embed`].
#[inline]
#[must_use]
pub fn into_inner(self) -> Embed {
self.0
}
}

impl Default for CreateEmbed {
Expand Down

0 comments on commit 8c84b4f

Please sign in to comment.