style: apply fmt to entire workspace

This commit is contained in:
Santiago Carmuega 2021-12-09 07:03:13 -03:00
parent 1b6cbbc095
commit 336d2400f4
23 changed files with 111 additions and 67 deletions

View file

@ -1,4 +1,4 @@
use std::{net::TcpListener, os::unix::net::UnixListener, thread, time::Duration};
use std::{os::unix::net::UnixListener, thread, time::Duration};
use pallas_multiplexer::{Channel, Multiplexer};
@ -15,7 +15,7 @@ fn main() {
for protocol in PROTOCOLS {
let handle = muxer.use_channel(protocol);
thread::spawn(move || {
let Channel(_, rx) = handle;

View file

@ -1,4 +1,4 @@
use std::{net::TcpStream, os::unix::net::UnixStream, thread, time::Duration};
use std::{os::unix::net::UnixStream, thread, time::Duration};
use pallas_multiplexer::{Channel, Multiplexer};
@ -20,9 +20,7 @@ fn main() {
loop {
let payload = vec![1; 65545];
tx.send(payload).unwrap();
thread::sleep(Duration::from_millis(
50u64 + (protocol as u64 * 10u64),
));
thread::sleep(Duration::from_millis(50u64 + (protocol as u64 * 10u64)));
}
});
}

View file

@ -1,6 +1,12 @@
mod bearers;
use std::{collections::HashMap, io::{Read, Write}, sync::mpsc::{self, Receiver, Sender, TryRecvError}, thread::{self, JoinHandle}, time::{Duration, Instant}};
use std::{
collections::HashMap,
io::{Read, Write},
sync::mpsc::{self, Receiver, Sender, TryRecvError},
thread::{self, JoinHandle},
time::{Duration, Instant},
};
use log::{debug, error, trace, warn};
@ -115,7 +121,10 @@ pub struct Multiplexer {
}
impl Multiplexer {
pub fn setup<TBearer>(bearer: TBearer, protocols: &[u16]) -> Result<Multiplexer, Box<dyn std::error::Error>>
pub fn setup<TBearer>(
bearer: TBearer,
protocols: &[u16],
) -> Result<Multiplexer, Box<dyn std::error::Error>>
where
TBearer: Bearer + 'static,
{