devtools: TabDescription actor

This commit is contained in:
Paul Rouget 2020-07-13 09:04:35 +02:00
parent 714acb942c
commit da80d4ff01
6 changed files with 148 additions and 28 deletions

View file

@ -159,7 +159,13 @@ impl ActorRegistry {
msg: &Map<String, Value>,
stream: &mut TcpStream,
) -> Result<(), ()> {
let to = msg.get("to").unwrap().as_str().unwrap();
let to = match msg.get("to") {
Some(to) => to.as_str().unwrap(),
None => {
warn!("Received unexpected message: {:?}", msg);
return Err(());
},
};
match self.actors.get(to) {
None => debug!("message received for unknown actor \"{}\"", to),