impl Question {
fn new(
id: QuestionId,
title: String,
content: String,
tags: Option<Vec<String>>
) -> Self {
Question {
id,
title,
content,
tags,
}
}
}
...
#[derive(Debug)]
struct InvalidId;
impl Reject for InvalidId {}
impl FromStr for QuestionId {
type Err = std::io::Error;
fn from_str(id: &str) -> Result<Self, Self::Err> {
match id.is_empty() {