mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-24 10:07:18 +00:00
Fix formatting.
This commit is contained in:
parent
a496d8af65
commit
c19dfdae64
|
@ -1,4 +1,11 @@
|
|||
use crate::{naive_now, schema::{post, post_like, post_read, post_saved}, Crud, Likeable, Saveable, Readable};
|
||||
use crate::{
|
||||
naive_now,
|
||||
schema::{post, post_like, post_read, post_saved},
|
||||
Crud,
|
||||
Likeable,
|
||||
Readable,
|
||||
Saveable,
|
||||
};
|
||||
use diesel::{dsl::*, result::Error, *};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use url::{ParseError, Url};
|
||||
|
|
|
@ -160,7 +160,9 @@ pub fn is_valid_username(name: &str) -> bool {
|
|||
|
||||
// Can't do a regex here, reverse lookarounds not supported
|
||||
pub fn is_valid_preferred_username(preferred_username: &str) -> bool {
|
||||
!preferred_username.starts_with("@") && preferred_username.len() >=3 && preferred_username.len() <= 20
|
||||
!preferred_username.starts_with("@")
|
||||
&& preferred_username.len() >= 3
|
||||
&& preferred_username.len() <= 20
|
||||
}
|
||||
|
||||
pub fn is_valid_community_name(name: &str) -> bool {
|
||||
|
@ -176,8 +178,8 @@ mod tests {
|
|||
use crate::{
|
||||
is_valid_community_name,
|
||||
is_valid_post_title,
|
||||
is_valid_username,
|
||||
is_valid_preferred_username,
|
||||
is_valid_username,
|
||||
remove_slurs,
|
||||
scrape_text_for_mentions,
|
||||
slur_check,
|
||||
|
|
Loading…
Reference in a new issue