remove a couple warnings
This commit is contained in:
18
src/main.rs
18
src/main.rs
@@ -59,7 +59,7 @@ fn prompt(anki: &AnkiClient) {
|
|||||||
KeyCode::Enter => break,
|
KeyCode::Enter => break,
|
||||||
_ => (),
|
_ => (),
|
||||||
},
|
},
|
||||||
e => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
anki.request(GuiShowAnswerRequest {}).unwrap();
|
anki.request(GuiShowAnswerRequest {}).unwrap();
|
||||||
@@ -71,13 +71,13 @@ fn prompt(anki: &AnkiClient) {
|
|||||||
}
|
}
|
||||||
display_prompt_text(":");
|
display_prompt_text(":");
|
||||||
let ease = loop {
|
let ease = loop {
|
||||||
let ease = match event::read().unwrap() {
|
match event::read().unwrap() {
|
||||||
Event::Key(e) => match e.code {
|
Event::Key(e) => match e.code {
|
||||||
KeyCode::Char(AGAIN) => break Ease::Again,
|
KeyCode::Char(AGAIN) => break Ease::Again,
|
||||||
KeyCode::Char(GOOD) => break Ease::Good,
|
KeyCode::Char(GOOD) => break Ease::Good,
|
||||||
_ => (),
|
_ => (),
|
||||||
},
|
},
|
||||||
e => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
anki.request(GuiAnswerCardRequest { ease: ease }).unwrap();
|
anki.request(GuiAnswerCardRequest { ease: ease }).unwrap();
|
||||||
@@ -105,7 +105,8 @@ fn clear_with_bar(anki: &AnkiClient, current_card: &GuiCurrentCardResponse) {
|
|||||||
SetForegroundColor(Color::Green),
|
SetForegroundColor(Color::Green),
|
||||||
Print(&format!("{:?}\n", deck_stats.review_count)),
|
Print(&format!("{:?}\n", deck_stats.review_count)),
|
||||||
ResetColor
|
ResetColor
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clear_screen() {
|
fn clear_screen() {
|
||||||
@@ -114,7 +115,8 @@ fn clear_screen() {
|
|||||||
Clear(ClearType::All),
|
Clear(ClearType::All),
|
||||||
cursor::MoveTo(0, 0),
|
cursor::MoveTo(0, 0),
|
||||||
cursor::Hide
|
cursor::Hide
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn display_prompt_text(text: &str) {
|
fn display_prompt_text(text: &str) {
|
||||||
@@ -123,7 +125,8 @@ fn display_prompt_text(text: &str) {
|
|||||||
SetForegroundColor(Color::Blue),
|
SetForegroundColor(Color::Blue),
|
||||||
Print(text),
|
Print(text),
|
||||||
ResetColor
|
ResetColor
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn display_html(html: &str) {
|
fn display_html(html: &str) {
|
||||||
@@ -137,5 +140,6 @@ fn display_text(text: &str) {
|
|||||||
SetForegroundColor(Color::DarkYellow),
|
SetForegroundColor(Color::DarkYellow),
|
||||||
Print(text),
|
Print(text),
|
||||||
ResetColor
|
ResetColor
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user