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

@@ -396,7 +396,7 @@ UPDATE chats SET protected=1, type=120 WHERE type=130;"#,
if dbversion < 71 {
info!(context, "[migration] v71");
if let Ok(addr) = context.get_primary_self_addr().await {
if let Ok(domain) = addr.parse::<EmailAddress>().map(|email| email.domain) {
if let Ok(domain) = EmailAddress::new(&addr).map(|email| email.domain) {
context
.set_config(
Config::ConfiguredProvider,