mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-05-20 02:38:05 +00:00
Consolidate Tagline error types
This commit is contained in:
parent
5cf15a4c8c
commit
7ce89fb5e6
|
@ -165,8 +165,7 @@ pub enum LemmyErrorType {
|
|||
InvalidUnixTime,
|
||||
InvalidBotAction,
|
||||
CantBlockLocalInstance,
|
||||
TaglineContentRequired,
|
||||
TaglineContentLengthOverflow,
|
||||
TaglineInvalid,
|
||||
Unknown(String),
|
||||
}
|
||||
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue