Skip to content

Commit

Permalink
codefmt
Browse files Browse the repository at this point in the history
  • Loading branch information
divi255 committed Feb 24, 2024
1 parent 2542f75 commit 6f92c38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,17 @@ async fn main() {
.unwrap();
let client = Arc::new(client);
tokio::spawn(async move {
loop {
signal(SignalKind::interrupt()).unwrap().recv().await;
client.bye().await.unwrap();
print!("{}[2J", 27 as char);
if let Ok(term) = std::env::var("TERM") {
if term.starts_with("screen") {
for s in &["reset", "cnorm"] {
let _r = std::process::Command::new("tput").arg(s).spawn();
}
signal(SignalKind::interrupt()).unwrap().recv().await;
client.bye().await.unwrap();
print!("{}[2J", 27 as char);
if let Ok(term) = std::env::var("TERM") {
if term.starts_with("screen") {
for s in &["reset", "cnorm"] {
let _r = std::process::Command::new("tput").arg(s).spawn();
}
}
std::process::exit(0);
}
std::process::exit(0);
});
let mut last_refresh: Option<Instant> = None;
let show_step = Duration::from_secs(1);
Expand Down Expand Up @@ -486,12 +484,10 @@ async fn main() {
info!("Listening to {}...", topics.join(", "));
client.subscribe_bulk(topics).await.unwrap();
tokio::spawn(async move {
loop {
signal(SignalKind::interrupt()).unwrap().recv().await;
info!("terminating");
client.bye().await.unwrap();
std::process::exit(0);
}
signal(SignalKind::interrupt()).unwrap().recv().await;
info!("terminating");
client.bye().await.unwrap();
std::process::exit(0);
});
loop {
let message = data_channel.recv().await.unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,7 @@ mod stats {

use serde::Serialize;
#[derive(Serialize, Debug, Clone, Default)]
#[allow(clippy::struct_field_names)]
pub struct Counters {
// counters
c_sub_ops: u64,
Expand Down

0 comments on commit 6f92c38

Please sign in to comment.