mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-07-15 01:24:27 +02:00
Use the rexported crossterm from ratatui
This commit is contained in:
@ -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},
|
||||
|
@ -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,
|
||||
|
@ -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},
|
||||
|
13
src/list.rs
13
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;
|
||||
|
@ -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::{
|
||||
|
@ -1,5 +1,5 @@
|
||||
use anyhow::Result;
|
||||
use crossterm::{
|
||||
use ratatui::crossterm::{
|
||||
style::{style, Stylize},
|
||||
terminal,
|
||||
};
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user