man/author.rs
1/// Application authors.
2#[derive(Debug, Clone)]
3pub struct Author {
4 pub(crate) name: String,
5 pub(crate) email: Option<String>,
6}
7
8impl Author {
9 /// Create a new instance.
10 pub fn new(name: &str) -> Self {
11 Self {
12 name: name.into(),
13 email: None,
14 }
15 }
16
17 /// Set the email field.
18 pub fn email(mut self, email: &str) -> Self {
19 self.email = Some(email.into());
20 self
21 }
22}