From 7ce89fb5e6a240ec334e025d39bfbb072cfa86cf Mon Sep 17 00:00:00 2001 From: Freek van Zee Date: Mon, 8 Apr 2024 21:28:55 +0200 Subject: [PATCH] Consolidate Tagline error types --- crates/utils/src/error.rs | 3 +-- crates/utils/src/utils/validation.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/utils/src/error.rs b/crates/utils/src/error.rs index 8a102b655..61bc5091b 100644 --- a/crates/utils/src/error.rs +++ b/crates/utils/src/error.rs @@ -165,8 +165,7 @@ pub enum LemmyErrorType { InvalidUnixTime, InvalidBotAction, CantBlockLocalInstance, - TaglineContentRequired, - TaglineContentLengthOverflow, + TaglineInvalid, Unknown(String), } diff --git a/crates/utils/src/utils/validation.rs b/crates/utils/src/utils/validation.rs index 067a7520c..dd89609f8 100644 --- a/crates/utils/src/utils/validation.rs +++ b/crates/utils/src/utils/validation.rs @@ -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(()) }