Skip to content

Commit

Permalink
update description
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoikey committed Feb 24, 2024
1 parent bf244ff commit c152ff5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rule/string/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ use crate::rule::Rule;
use crate::Refined;
use regex::Regex;

/// The `Email` type represents a type that conforms to the format of an Email.
///
/// # Example
/// ```rust
/// # use refined_type::rule::Email;
///
/// let valid = "[email protected]".to_string();
/// assert!(Email::new(valid).is_ok());
///
/// let invalid = "example.com".to_string();
/// assert!(Email::new(invalid).is_err());
/// ```
pub type Email = Refined<EmailRule>;

pub struct EmailRule;
Expand Down

0 comments on commit c152ff5

Please sign in to comment.