pub fn validate_poll_link(link: &Option<String>) -> Result<(), ContractError> {
    if let Some(link) = link {
        if link.len() < MIN_LINK_LENGTH {
            Err(ContractError::PollLinkInvalidShort(MIN_LINK_LENGTH))
        } else if link.len() > MAX_LINK_LENGTH {
            Err(ContractError::PollLinkInvalidLong(MAX_LINK_LENGTH))
        } else {
            Ok(())
        }
    } else {
        Ok(())
    }
}
/**
 * Validates that the link is valid when creating a poll.
 */
Validates that the link is valid when creating a poll.
Validates that the link is valid when creating a poll .
pub fn validate_poll_link(link: &Option<String>) -> Result<(), ContractError> {
    if let Some(link) = link {
        if link.len() < MIN_LINK_LENGTH {
            Err(ContractError::PollLinkInvalidShort(MIN_LINK_LENGTH))
        } else if link.len() > MAX_LINK_LENGTH {
            Err(ContractError::PollLinkInvalidLong(MAX_LINK_LENGTH))
        } else {
            Ok(())
        }
    } else {
        Ok(())
    }
}
pub fn validate_poll_link ( link : & Option < String > ) -> Result < ( ) , ContractError > { if let Some ( link ) = link { if link . len ( ) < MIN_LINK_LENGTH { Err ( ContractError :: PollLinkInvalidShort ( MIN_LINK_LENGTH ) ) } else if link . len ( ) > MAX_LINK_LENGTH { Err ( ContractError :: PollLinkInvalidLong ( MAX_LINK_LENGTH ) ) } else { Ok ( ( ) ) } } else { Ok ( ( ) ) } }
Validates that the link is valid when creating a poll.
Validates that the link is valid when creating a poll .
link
&Option<String>
link
&Option<String>