(id: &str)
| 29 | type Err = std::io::Error; |
| 30 | |
| 31 | fn from_str(id: &str) -> Result<Self, Self::Err> { |
| 32 | match id.is_empty() { |
| 33 | false => Ok(QuestionId(id.to_string())), |
| 34 | true => Err(Error::new(ErrorKind::InvalidInput, "No id provided")), |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | #[tokio::main] |