더북(TheBook)

코드 2-19 FromStr 트레이트로 &str에서 QuestionId 만들기

...
fn main() {
    let question = Question::new(
        QuestionId::from_str("1").expect("No id provided"),
        "First Question".to_string(),
        "Content of question".to_string(),
        Some(vec!["faq".to_string()]),
    );
    println!("{:?}", question);
}