question 0.2.2

Ask a question, what more could you want?
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate question;
use question::{Answer, Question};

fn main() {
    let question = "What is the answer to the Ultimate Question of Life, \
                    the Universe, and Everything?";

    let default = Answer::RESPONSE(String::from("42"));
    let answer = Question::new(question)
        .default(default.clone())
        .show_defaults()
        .ask()
        .unwrap();
    let correct = default;
    assert_eq!(answer, correct);
}