diff options
| author | mo8it <mo8it@proton.me> | 2024-07-25 16:26:48 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-25 16:26:48 +0200 |
| commit | 1937b4bf664568afcdb2c73247b593299d3fca6d (patch) | |
| tree | 4af8ef68950c1d02238e962ac96f6d97dc947b83 /src | |
| parent | 8beb2908420b0225aabe983e3425055db761b356 (diff) | |
Use the rexported crossterm from ratatui
Diffstat (limited to 'src')
| -rw-r--r-- | src/app_state.rs | 2 | ||||
| -rw-r--r-- | src/exercise.rs | 2 | ||||
| -rw-r--r-- | src/init.rs | 2 | ||||
| -rw-r--r-- | src/list.rs | 13 | ||||
| -rw-r--r-- | src/progress_bar.rs | 2 | ||||
| -rw-r--r-- | src/run.rs | 2 | ||||
| -rw-r--r-- | src/watch/state.rs | 2 | ||||
| -rw-r--r-- | src/watch/terminal_event.rs | 2 |
8 files changed, 15 insertions, 12 deletions
diff --git a/src/app_state.rs b/src/app_state.rs index e08f94c..8995e81 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Context, Result}; -use crossterm::style::Stylize; +use ratatui::crossterm::style::Stylize; use serde::Deserialize; use std::{ fs::{self, File}, diff --git a/src/exercise.rs b/src/exercise.rs index b6adc14..960eec0 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use crossterm::style::{style, StyledContent, Stylize}; +use ratatui::crossterm::style::{style, StyledContent, Stylize}; use std::{ fmt::{self, Display, Formatter}, io::Write, diff --git a/src/init.rs b/src/init.rs index 4063ca7..bfa0ab8 100644 --- a/src/init.rs +++ b/src/init.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Context, Result}; -use crossterm::style::Stylize; +use ratatui::crossterm::style::Stylize; use std::{ env::set_current_dir, fs::{self, create_dir}, diff --git a/src/list.rs b/src/list.rs index 790c02f..15836a4 100644 --- a/src/list.rs +++ b/src/list.rs @@ -1,10 +1,13 @@ use anyhow::Result; -use crossterm::{ - event::{self, Event, KeyCode, KeyEventKind}, - terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, - ExecutableCommand, +use ratatui::{ + backend::CrosstermBackend, + crossterm::{ + event::{self, Event, KeyCode, KeyEventKind}, + terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, + ExecutableCommand, + }, + Terminal, }; -use ratatui::{backend::CrosstermBackend, Terminal}; use std::io; use crate::app_state::AppState; diff --git a/src/progress_bar.rs b/src/progress_bar.rs index 4a54170..7f07ad5 100644 --- a/src/progress_bar.rs +++ b/src/progress_bar.rs @@ -14,7 +14,7 @@ const PROGRESS_EXCEEDS_MAX_ERR: &str = /// Terminal progress bar to be used when not using Ratataui. pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String> { - use crossterm::style::Stylize; + use ratatui::crossterm::style::Stylize; if progress > total { bail!(PROGRESS_EXCEEDS_MAX_ERR); @@ -1,5 +1,5 @@ use anyhow::{bail, Result}; -use crossterm::style::{style, Stylize}; +use ratatui::crossterm::style::{style, Stylize}; use std::io::{self, Write}; use crate::{ diff --git a/src/watch/state.rs b/src/watch/state.rs index 78af30a..26ff411 100644 --- a/src/watch/state.rs +++ b/src/watch/state.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use crossterm::{ +use ratatui::crossterm::{ style::{style, Stylize}, terminal, }; diff --git a/src/watch/terminal_event.rs b/src/watch/terminal_event.rs index f54af17..3a1762d 100644 --- a/src/watch/terminal_event.rs +++ b/src/watch/terminal_event.rs @@ -1,4 +1,4 @@ -use crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers}; +use ratatui::crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers}; use std::sync::mpsc::Sender; use super::WatchEvent; |
