mirror of
https://github.com/figsoda/mmtc
synced 2025-02-16 13:28:33 +00:00
improve error message upon failing to draw to term
This commit is contained in:
parent
e6ffa2fb54
commit
373300d890
1 changed files with 3 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
|||
use anyhow::{Context, Result};
|
||||
use tui::{
|
||||
backend::Backend,
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||
|
@ -33,14 +34,11 @@ struct ConditionState<'a> {
|
|||
query: &'a str,
|
||||
}
|
||||
|
||||
pub fn render(
|
||||
term: &mut Terminal<impl Backend>,
|
||||
widget: &Widget,
|
||||
s: &mut State,
|
||||
) -> std::io::Result<()> {
|
||||
pub fn render(term: &mut Terminal<impl Backend>, widget: &Widget, s: &mut State) -> Result<()> {
|
||||
term.draw(|frame| {
|
||||
_render(frame, frame.size(), widget, s);
|
||||
})
|
||||
.context("Failed to draw to terminal")
|
||||
}
|
||||
|
||||
fn _render(frame: &mut Frame<impl Backend>, size: Rect, widget: &Widget, s: &mut State) {
|
||||
|
|
Loading…
Add table
Reference in a new issue