fix(core/models): validator feature flag not properly gatekept

This commit is contained in:
Paul Makles
2023-10-20 18:16:12 +01:00
committed by Paul Makles
parent 29dcf714f2
commit 96d90215d2
3 changed files with 11 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
use once_cell::sync::Lazy;
use regex::Regex;
#[cfg(feature = "validator")]
use validator::Validate;
/// Regex for valid emoji names
@@ -41,7 +43,7 @@ auto_derived!(
}
/// Create a new emoji
#[derive(Validate)]
#[cfg_attr(feature = "validator", derive(Validate))]
pub struct DataCreateEmoji {
/// Server name
#[validate(length(min = 1, max = 32), regex = "RE_EMOJI")]