rustfmt project and change binary name
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
813667093e
commit
35296f13b0
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1270,7 +1270,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ghost-gossiper"
|
||||
name = "ghost-echo"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "ghost-echo"
|
||||
version = "0.0.1"
|
||||
version = "0.0.2"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "ghost-gossiper"
|
||||
name = "ghost-echo"
|
||||
path = "src/bin/main.rs"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use ghost_gossiper::prelude::*;
|
||||
use ghost_echo::prelude::*;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
|
||||
@ -19,7 +19,11 @@ use ratatui::{
|
||||
Terminal,
|
||||
};
|
||||
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_util::sync::CancellationToken;
|
||||
@ -243,7 +247,8 @@ fn wrap_text<'a>(line: Line<'a>, max_width: usize) -> Vec<Line<'a>> {
|
||||
return vec![Line::from("")];
|
||||
}
|
||||
|
||||
let leading_whitespace = words_with_styles[0].0
|
||||
let leading_whitespace = words_with_styles[0]
|
||||
.0
|
||||
.chars()
|
||||
.take_while(|c| c.is_whitespace())
|
||||
.collect::<String>();
|
||||
@ -427,15 +432,13 @@ impl<'a> ChatWidget<'a> {
|
||||
|
||||
let color_index = (hash % 216) as u8 + 16;
|
||||
|
||||
self.chat.add_line(
|
||||
Line::from(vec![
|
||||
time_str.to_string().into(),
|
||||
" ".into(),
|
||||
peer.fg(Color::Indexed(color_index)),
|
||||
": ".into(),
|
||||
message.into().into()
|
||||
])
|
||||
)
|
||||
self.chat.add_line(Line::from(vec![
|
||||
time_str.to_string().into(),
|
||||
" ".into(),
|
||||
peer.fg(Color::Indexed(color_index)),
|
||||
": ".into(),
|
||||
message.into().into(),
|
||||
]))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user