rustfmt project and change binary name

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-12-21 16:47:19 +03:00
parent 813667093e
commit 35296f13b0
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
4 changed files with 18 additions and 15 deletions

2
Cargo.lock generated
View File

@ -1270,7 +1270,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "ghost-gossiper" name = "ghost-echo"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",

View File

@ -1,10 +1,10 @@
[package] [package]
name = "ghost-echo" name = "ghost-echo"
version = "0.0.1" version = "0.0.2"
edition = "2021" edition = "2021"
[[bin]] [[bin]]
name = "ghost-gossiper" name = "ghost-echo"
path = "src/bin/main.rs" path = "src/bin/main.rs"
[dependencies] [dependencies]

View File

@ -1,4 +1,4 @@
use ghost_gossiper::prelude::*; use ghost_echo::prelude::*;
use anyhow::Result; use anyhow::Result;
use clap::Parser; use clap::Parser;

View File

@ -19,7 +19,11 @@ use ratatui::{
Terminal, Terminal,
}; };
use std::{ use std::{
collections::{HashSet, VecDeque}, hash::{DefaultHasher, Hash, Hasher}, io, option::Option, time::Duration collections::{HashSet, VecDeque},
hash::{DefaultHasher, Hash, Hasher},
io,
option::Option,
time::Duration,
}; };
use tokio::sync::mpsc::{self, Receiver, Sender}; use tokio::sync::mpsc::{self, Receiver, Sender};
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
@ -243,7 +247,8 @@ fn wrap_text<'a>(line: Line<'a>, max_width: usize) -> Vec<Line<'a>> {
return vec![Line::from("")]; return vec![Line::from("")];
} }
let leading_whitespace = words_with_styles[0].0 let leading_whitespace = words_with_styles[0]
.0
.chars() .chars()
.take_while(|c| c.is_whitespace()) .take_while(|c| c.is_whitespace())
.collect::<String>(); .collect::<String>();
@ -427,15 +432,13 @@ impl<'a> ChatWidget<'a> {
let color_index = (hash % 216) as u8 + 16; let color_index = (hash % 216) as u8 + 16;
self.chat.add_line( self.chat.add_line(Line::from(vec![
Line::from(vec![
time_str.to_string().into(), time_str.to_string().into(),
" ".into(), " ".into(),
peer.fg(Color::Indexed(color_index)), peer.fg(Color::Indexed(color_index)),
": ".into(), ": ".into(),
message.into().into() message.into().into(),
]) ]))
)
} }
} }