Fix formatting: reformat imports and thread closure
Apply rustfmt to fix formatting issues: - Reformat nested use statement for std::sync imports - Reformat thread::spawn closure to use inline loop syntax 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,10 @@ use crate::color::{apply, ColorEngine};
|
|||||||
use crate::utils::{ansi, ascii::AsciiArt, terminal::TerminalManager};
|
use crate::utils::{ansi, ascii::AsciiArt, terminal::TerminalManager};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossterm::event::{self, Event, KeyCode, KeyModifiers};
|
use crossterm::event::{self, Event, KeyCode, KeyModifiers};
|
||||||
use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
|
use std::sync::{
|
||||||
|
atomic::{AtomicBool, Ordering},
|
||||||
|
Arc,
|
||||||
|
};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
|
|
||||||
@@ -41,8 +44,7 @@ impl<'a> Renderer<'a> {
|
|||||||
let should_exit = Arc::new(AtomicBool::new(false));
|
let should_exit = Arc::new(AtomicBool::new(false));
|
||||||
let should_exit_clone = should_exit.clone();
|
let should_exit_clone = should_exit.clone();
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || loop {
|
||||||
loop {
|
|
||||||
if let Ok(true) = event::poll(Duration::from_millis(100)) {
|
if let Ok(true) = event::poll(Duration::from_millis(100)) {
|
||||||
if let Ok(Event::Key(key)) = event::read() {
|
if let Ok(Event::Key(key)) = event::read() {
|
||||||
match key.code {
|
match key.code {
|
||||||
@@ -61,7 +63,6 @@ impl<'a> Renderer<'a> {
|
|||||||
if should_exit_clone.load(Ordering::Relaxed) {
|
if should_exit_clone.load(Ordering::Relaxed) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user