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:
@ -67,23 +67,21 @@ impl Session {
|
||||
SessionMsg::Get(req_id) => {
|
||||
let id: Uuid;
|
||||
match req_id {
|
||||
Some(req) => {
|
||||
match Uuid::try_parse(req) {
|
||||
Ok(data) => {
|
||||
if self.ids.contains(&data) {
|
||||
id = data;
|
||||
} else {
|
||||
id = self.create_session();
|
||||
}
|
||||
},
|
||||
Err(_) => id = self.create_session(),
|
||||
Some(req) => match Uuid::try_parse(req) {
|
||||
Ok(data) => {
|
||||
if self.ids.contains(&data) {
|
||||
id = data;
|
||||
} else {
|
||||
id = self.create_session();
|
||||
}
|
||||
}
|
||||
Err(_) => id = self.create_session(),
|
||||
},
|
||||
None => id = self.create_session(),
|
||||
}
|
||||
let data = SessionMsg::Opened(SessionData::new(id));
|
||||
self.router_tx.send(msg.reply(&data)).unwrap()
|
||||
},
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {}
|
||||
@ -229,7 +227,11 @@ mod messages {
|
||||
assert_eq!(result.get_id(), msg.get_id());
|
||||
match result.get_message() {
|
||||
MsgData::Session(data) => match data {
|
||||
SessionMsg::Opened(sess) => assert_eq!(sess.to_string(), thesess.to_string(), "Should use existing sesssion."),
|
||||
SessionMsg::Opened(sess) => assert_eq!(
|
||||
sess.to_string(),
|
||||
thesess.to_string(),
|
||||
"Should use existing sesssion."
|
||||
),
|
||||
_ => unreachable!("Should habe been an Opened message."),
|
||||
},
|
||||
_ => unreachable!("Should have been a session message."),
|
||||
|
Reference in New Issue
Block a user