(id: &str)
| 38 | type Err = std::io::Error; |
| 39 | |
| 40 | fn from_str(id: &str) -> Result<Self, Self::Err> { |
| 41 | match id.is_empty() { |
| 42 | false => Ok(QuestionId(id.to_string())), |
| 43 | true => Err(Error::new(ErrorKind::InvalidInput, "No id provided")), |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 |