mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
Move the actual logic of email parsing to EmailAddress::new() (#3656)
Very small PR; Motivation: Easier navigation using Go-To-definition. Because, using go-to-definition of rust-analyzer on parse() doesn't take you to the actual parse() implementation but its trait definiton. On the other hand, it's very easy to find EmailAddress::new().
This commit is contained in:
@@ -1183,7 +1183,7 @@ impl Contact {
|
||||
|
||||
/// Returns false if addr is an invalid address, otherwise true.
|
||||
pub fn may_be_valid_addr(addr: &str) -> bool {
|
||||
let res = addr.parse::<EmailAddress>();
|
||||
let res = EmailAddress::new(addr);
|
||||
res.is_ok()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user