Rename User -> UserInfo in examples/simple_dialogue

This commit is contained in:
Temirkhan Myrzamadi 2020-02-11 03:51:50 +06:00
parent 4a7c31fec7
commit afb6677a1e

View file

@ -33,17 +33,17 @@ impl FavouriteMusic {
}
// ============================================================================
// [A user's data]
// [A UserInfo's data]
// ============================================================================
#[derive(Default)]
struct User {
struct UserInfo {
full_name: Option<String>,
age: Option<u8>,
favourite_music: Option<FavouriteMusic>,
}
impl Display for User {
impl Display for UserInfo {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
write!(
f,
@ -72,8 +72,8 @@ enum State {
// [Control a dialogue]
// ============================================================================
type Ctx = DialogueHandlerCtx<Message, State, User>;
type Res = Result<DialogueStage<State, User>, RequestError>;
type Ctx = DialogueHandlerCtx<Message, State, UserInfo>;
type Res = Result<DialogueStage<State, UserInfo>, RequestError>;
async fn send_favourite_music_types(ctx: &Ctx) -> Result<(), RequestError> {
ctx.answer("Good. Now choose your favourite music:")