pub fn embeds(embeds: &[Embed]) -> Result<(), MessageValidationError> {
    if embeds.len() > EMBED_COUNT_LIMIT {
        Err(MessageValidationError {
            kind: MessageValidationErrorType::TooManyEmbeds,
            source: None,
        })
    } else {
        for (idx, embed) in embeds.iter().enumerate() {
            crate::embed::embed(embed).map_err(|source| {
                let (kind, source) = source.into_parts();

                MessageValidationError {
                    kind: MessageValidationErrorType::EmbedInvalid { idx, kind },
                    source,
                }
            })?;
        }

        Ok(())
    }
}
/// Ensure a list of embeds is correct.
///
/// # Errors
///
/// Returns an error of type [`TooManyEmbeds`] if there are too many embeds.
///
/// Otherwise, refer to the errors section of [`embed`] for a list of errors
/// that may occur.
///
/// [`TooManyEmbeds`]: MessageValidationErrorType::TooManyEmbeds
/// [`embed`]: crate::embed::embed
Ensure a list of embeds is correct.
Ensure a list of embeds is correct .
pub fn embeds(embeds: &[Embed]) -> Result<(), MessageValidationError> {
    if embeds.len() > EMBED_COUNT_LIMIT {
        Err(MessageValidationError {
            kind: MessageValidationErrorType::TooManyEmbeds,
            source: None,
        })
    } else {
        for (idx, embed) in embeds.iter().enumerate() {
            crate::embed::embed(embed).map_err(|source| {
                let (kind, source) = source.into_parts();
                MessageValidationError {
                    kind: MessageValidationErrorType::EmbedInvalid { idx, kind },
                    source,
                }
            })?;
        }
        Ok(())
    }
}
pub fn embeds ( embeds : & [ Embed ] ) -> Result < ( ) , MessageValidationError > { if embeds . len ( ) > EMBED_COUNT_LIMIT { Err ( MessageValidationError { kind : MessageValidationErrorType :: TooManyEmbeds , source : None , } ) } else { for ( idx , embed ) in embeds . iter ( ) . enumerate ( ) { crate :: embed :: embed ( embed ) . map_err ( | source | { let ( kind , source ) = source . into_parts ( ) ; MessageValidationError { kind : MessageValidationErrorType :: EmbedInvalid { idx , kind } , source , } } ) ? ; } Ok ( ( ) ) } }
Ensure a list of embeds is correct.
Ensure a list of embeds is correct .
embeds
&[Embed]
errors
Returns an error of type [`TooManyEmbeds`] if there are too many embeds.

Otherwise, refer to the errors section of [`embed`] for a list of errors
that may occur.


Returns an error of type [ ` TooManyEmbeds ` ] if there are too many embeds . Otherwise refer to the errors section of [ ` embed ` ] for a list of errors that may occur .