Moved record to data.
Some checks failed
MoreThanText/morethantext/pipeline/head There was a failure building this commit
Some checks failed
MoreThanText/morethantext/pipeline/head There was a failure building this commit
This commit is contained in:
20
src/lib.rs
20
src/lib.rs
@ -1,5 +1,5 @@
|
||||
mod client;
|
||||
mod record;
|
||||
mod data;
|
||||
mod message;
|
||||
mod router;
|
||||
mod session;
|
||||
@ -8,9 +8,7 @@ use client::{Client, ClientMsg};
|
||||
use message::{Message, MsgData};
|
||||
use router::Router;
|
||||
use session::{Session, SessionData, SessionMsg};
|
||||
use std::{
|
||||
sync::mpsc::{channel, Sender},
|
||||
};
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
|
||||
/// Support functions for Messages.
|
||||
pub trait Msg {
|
||||
@ -84,13 +82,11 @@ impl MoreThanText {
|
||||
let msg = Message::new(&req);
|
||||
self.tx.send(msg).unwrap();
|
||||
match rx.recv().unwrap().get_message() {
|
||||
MsgData::Session(data) => {
|
||||
match data {
|
||||
SessionMsg::Opened(sess) => self.session = Some(sess.clone()),
|
||||
_ => {},
|
||||
}
|
||||
MsgData::Session(data) => match data {
|
||||
SessionMsg::Opened(sess) => self.session = Some(sess.clone()),
|
||||
_ => {}
|
||||
},
|
||||
_ => {},
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
|
||||
@ -115,8 +111,8 @@ impl MoreThanText {
|
||||
impl Clone for MoreThanText {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
session: None,
|
||||
tx: self.tx.clone(),
|
||||
session: None,
|
||||
tx: self.tx.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user