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]]
|
[[package]]
|
||||||
name = "ghost-gossiper"
|
name = "ghost-echo"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
@ -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]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use ghost_gossiper::prelude::*;
|
use ghost_echo::prelude::*;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|||||||
@ -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()
|
]))
|
||||||
])
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user