update nebkor-maelstrom dep
This commit is contained in:
parent
a49ddffa56
commit
8ada835f81
2 changed files with 4 additions and 9 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -67,9 +67,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
|||
|
||||
[[package]]
|
||||
name = "nebkor-maelstrom"
|
||||
version = "0.0.1"
|
||||
version = "0.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83dd99cc42f1882a9a269091b25a3afb88f6237ed56bc255659e49aaf9e89fc3"
|
||||
checksum = "aae3eeab09bcb4f923122da7b5962b2f02fcbd7201baf45c679a6c6a258fdb11"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
|
@ -90,9 +90,6 @@ impl BCaster {
|
|||
impl Node for BCaster {
|
||||
fn handle(&mut self, runner: &Runner, req: Message) {
|
||||
let typ = req.body.typ.as_str();
|
||||
let frm = req.src.as_str();
|
||||
let nid = runner.node_id();
|
||||
let nid = nid.as_str();
|
||||
|
||||
match typ {
|
||||
"do_gossip" => {
|
||||
|
@ -116,6 +113,7 @@ impl Node for BCaster {
|
|||
runner.reply(&req, body);
|
||||
}
|
||||
"topology" => {
|
||||
let nid = runner.node_id();
|
||||
self.topology(runner.nodes(), nid);
|
||||
let body = Body::from_type("topology_ok");
|
||||
runner.reply(&req, body);
|
||||
|
@ -133,10 +131,7 @@ impl Node for BCaster {
|
|||
.collect::<HashSet<_>>();
|
||||
|
||||
self.store.extend(goss.clone());
|
||||
self.gossips
|
||||
.entry(frm.to_string())
|
||||
.or_default()
|
||||
.extend(goss);
|
||||
self.gossips.entry(req.src).or_default().extend(goss);
|
||||
}
|
||||
|
||||
_ => {
|
||||
|
|
Loading…
Reference in a new issue