Skip to content

Commit c152ff5

Browse files
committed
update description
1 parent bf244ff commit c152ff5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rule/string/email.rs

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ use crate::rule::Rule;
33
use crate::Refined;
44
use regex::Regex;
55

6+
/// The `Email` type represents a type that conforms to the format of an Email.
7+
///
8+
/// # Example
9+
/// ```rust
10+
/// # use refined_type::rule::Email;
11+
///
12+
/// let valid = "[email protected]".to_string();
13+
/// assert!(Email::new(valid).is_ok());
14+
///
15+
/// let invalid = "example.com".to_string();
16+
/// assert!(Email::new(invalid).is_err());
17+
/// ```
618
pub type Email = Refined<EmailRule>;
719

820
pub struct EmailRule;

0 commit comments

Comments
 (0)