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:
Hocuri
2022-10-12 20:37:17 +02:00
committed by GitHub
parent 7ed947f598
commit 0e2445c7a0
6 changed files with 28 additions and 29 deletions

View File

@@ -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()
}