rustfmt
This commit is contained in:
parent
6bc88ef6b0
commit
50cf832c3f
12
src/main.rs
12
src/main.rs
|
@ -1,11 +1,11 @@
|
|||
mod adaptors;
|
||||
mod drivers;
|
||||
use crate::adaptors::{Adaptor,FakeAdaptor};
|
||||
use crate::adaptors::{Adaptor, FakeAdaptor};
|
||||
use crate::drivers::{Driver, FakeDriver};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Channel (Option<u8>);
|
||||
pub struct Channel(Option<u8>);
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct TallyState {
|
||||
|
@ -28,23 +28,23 @@ impl fmt::Display for TallyState {
|
|||
}
|
||||
}
|
||||
|
||||
struct Server<T:Adaptor,U:Driver> {
|
||||
struct Server<T: Adaptor, U: Driver> {
|
||||
adaptor: T,
|
||||
driver: U,
|
||||
}
|
||||
|
||||
impl<T:Adaptor,U:Driver> Server<T,U> {
|
||||
impl<T: Adaptor, U: Driver> Server<T, U> {
|
||||
fn run(&mut self) {
|
||||
let rx = self.adaptor.run();
|
||||
let tx = self.driver.run();
|
||||
loop{
|
||||
loop {
|
||||
tx.send(rx.recv().unwrap()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut s = Server{
|
||||
let mut s = Server {
|
||||
adaptor: FakeAdaptor::new(8),
|
||||
driver: FakeDriver::new(),
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue