Consolidate Tagline error types

This commit is contained in:
Freek van Zee 2024-04-08 21:28:55 +02:00
parent 5cf15a4c8c
commit 7ce89fb5e6
2 changed files with 3 additions and 4 deletions

View file

@ -165,8 +165,7 @@ pub enum LemmyErrorType {
InvalidUnixTime,
InvalidBotAction,
CantBlockLocalInstance,
TaglineContentRequired,
TaglineContentLengthOverflow,
TaglineInvalid,
Unknown(String),
}

View file

@ -175,12 +175,12 @@ pub fn is_valid_tagline_content(content: &str) -> LemmyResult<()> {
min_length_check(
content,
TAGLINE_CONTENT_MIN_LENGTH,
LemmyErrorType::TaglineContentRequired,
LemmyErrorType::TaglineInvalid,
)?;
max_length_check(
content,
TAGLINE_CONTENT_MAX_LENGTH,
LemmyErrorType::TaglineContentLengthOverflow,
LemmyErrorType::TaglineInvalid,
)?;
Ok(())
}