Skip to content

Commit

Permalink
Fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Dec 17, 2023
1 parent 1597bd5 commit 9241ff1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn validate_email(email: &str) -> Result<(), RegistrationError> {
Regex::new(r"^[^@\s]+@[^@\s]+\.[^@\s]+$")
.unwrap()
.is_match(email)
.then(|| ())
.then_some(())
.ok_or(RegistrationError::InvalidEmail)
}

Expand Down
2 changes: 1 addition & 1 deletion src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ pub fn linebreaksbr(value: &Value, _: &HashMap<String, Value>) -> tera::Result<V
} else {
return Err("The linebreaksbr filter can only be applied to strings".into());
};
Ok(Value::String(text.replace("\r\n", "<br>").replace("\n", "<br>")))
Ok(Value::String(text.replace("\r\n", "<br>").replace('\n', "<br>")))
}
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::needless_borrow)]

#[macro_use]
extern crate diesel;
extern crate diesel_migrations;
Expand Down

0 comments on commit 9241ff1

Please sign in to comment.