Skip to content

Commit

Permalink
Import ratatui explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Nov 2, 2023
1 parent 992b1cb commit 765a346
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"

[dependencies]
crossterm = "0.26.1"
tui = { package = "ratatui", version = "0.24.0" }
ratatui = "0.24.0"
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use {{crate_name}}::app::{App, AppResult};
use {{crate_name}}::event::{Event, EventHandler};
use {{crate_name}}::handler::handle_key_events;
use {{crate_name}}::tui::Tui;
use {{crate_name}}::ratatui::Tui;
use std::io;
use tui::backend::CrosstermBackend;
use tui::Terminal;
use ratatui::backend::CrosstermBackend;
use ratatui::Terminal;

fn main() -> AppResult<()> {
// Create an application.
Expand Down
6 changes: 3 additions & 3 deletions src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
use crossterm::terminal::{self, EnterAlternateScreen, LeaveAlternateScreen};
use std::io;
use std::panic;
use tui::backend::Backend;
use tui::Terminal;
use ratatui::backend::Backend;
use ratatui::Terminal;

/// Representation of a terminal user interface.
///
Expand Down Expand Up @@ -48,7 +48,7 @@ impl<B: Backend> Tui<B> {

/// [`Draw`] the terminal interface by [`rendering`] the widgets.
///
/// [`Draw`]: tui::Terminal::draw
/// [`Draw`]: ratatui::Terminal::draw
/// [`rendering`]: crate::ui:render
pub fn draw(&mut self, app: &mut App) -> AppResult<()> {
self.terminal.draw(|frame| ui::render(app, frame))?;
Expand Down
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use tui::{
use ratatui::{
layout::Alignment,
style::{Color, Style},
widgets::{Block, BorderType, Borders, Paragraph},
Expand Down

0 comments on commit 765a346

Please sign in to comment.