Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cht committed Dec 4, 2021
1 parent c42d691 commit 30300a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Resu
loop {
// here ,need with different tab ,use different draw funcitons
//terminal.draw(|f| render::ui(f, &mut app))?;
if let IFEXIT::Exit = render::run_app_subscribe(terminal,&mut app)? {
if let IFEXIT::Exit = render::run_app_subscribe(terminal, &mut app)? {
return Ok(());
}
}
Expand Down
14 changes: 8 additions & 6 deletions src/subscribe/render.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
use super::app::*;
use super::IFEXIT;
use std::io;
use tui::{
Terminal,
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
style::{Color, Modifier, Style},
text::{Span, Spans, Text},
widgets::{Block, Borders, Clear, List, ListItem, Paragraph},
Frame,
Frame, Terminal,
};
use unicode_width::UnicodeWidthStr;
use super::IFEXIT;
use std::io;
pub fn run_app_subscribe<B: Backend>(terminal: &mut Terminal<B>,app: &mut App) -> io::Result<IFEXIT> {
terminal.draw(|f| ui(f,app))?;
pub fn run_app_subscribe<B: Backend>(
terminal: &mut Terminal<B>,
app: &mut App,
) -> io::Result<IFEXIT> {
terminal.draw(|f| ui(f, app))?;
super::state::subscribe_state(app)
}
fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
Expand Down

0 comments on commit 30300a3

Please sign in to comment.