Skip to content

Commit

Permalink
Add rustfmt config and reformat everything
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Reidel <[email protected]>
  • Loading branch information
Gelbpunkt committed Jan 31, 2023
1 parent b4bb586 commit 1d98f52
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
8 changes: 8 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
edition = "2021"
newline_style = "Unix"
format_code_in_doc_comments = true
reorder_impl_items = true
comment_width = 80
wrap_comments = true
normalize_comments = true
imports_granularity = "crate"
group_imports = "StdExternalCrate"
9 changes: 5 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use crate::communication::SendMode;

use log::warn;
use nanoserde::DeJson;
use std::{
env::{args, set_var, var},
fmt::{Display, Formatter, Result as FmtResult},
fs::read_to_string,
path::Path,
};

use log::warn;
use nanoserde::DeJson;

use crate::communication::SendMode;

#[derive(Clone, Debug, DeJson)]
pub struct AccountData {
pub username: String,
Expand Down
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#![deny(clippy::pedantic)]
use std::{
net::{Ipv4Addr, SocketAddrV4},
process::exit,
sync::Arc,
time::{SystemTime, UNIX_EPOCH},
};

use dashmap::DashSet;
use libc::{c_int, sighandler_t, signal, SIGINT, SIGTERM};
use log::{debug, error, info, trace, warn};
Expand All @@ -21,13 +28,6 @@ use tokio::{
};
use worker::WorkerHandle;

use std::{
net::{Ipv4Addr, SocketAddrV4},
process::exit,
sync::Arc,
time::{SystemTime, UNIX_EPOCH},
};

mod communication;
mod config;
mod select;
Expand Down
4 changes: 2 additions & 2 deletions src/worker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::config::Config;
use std::{fmt, sync::Arc};

use dashmap::{DashMap, DashSet};
use log::{debug, error, info, trace};
Expand All @@ -17,7 +17,7 @@ use tokio::{
task::JoinHandle,
};

use std::{fmt, sync::Arc};
use crate::config::Config;

// An actor-like struct
struct Worker {
Expand Down

0 comments on commit 1d98f52

Please sign in to comment.