Skip to main content

canonicalize_email

Function canonicalize_email 

Source
pub fn canonicalize_email(address: &str) -> Result<String>
Expand description

Canonicalize an email address for storage and matching: case-fold the whole address and lower-case the domain. This is stronger than str::to_lowercase, which leaves ß intact; case-folding maps it to ss so Strauß@Example.com and strauss@example.com collide on one key.

Errors when the address exceeds MAX_EMAIL_LEN or has no @ separating a non-empty local part from a non-empty domain.