Commit 6c839e92 authored by nanamicat's avatar nanamicat

clean

parent ec9a95bf
Pipeline #42416 passed with stages
in 59 seconds
......@@ -29,7 +29,7 @@ pub struct Downlink {
pub plan: BTreeMap<u8, BTreeMap<u8, u8>>,
}
#[derive(Encode, Decode, Serialize, Copy, Clone, Debug)]
#[derive(Encode, Decode, Serialize, Copy, Clone, Debug, Default)]
pub struct PeerQuality {
pub delay: i16,
pub reliability: u8,
......
......@@ -41,16 +41,7 @@ impl Router {
peers: connections
.iter()
.filter(|(_, to)| to.contains_key(&data.id))
.map(|(&from, _)| {
(
from,
PeerQuality {
delay: 0,
reliability: 0,
jitter: 0,
},
)
})
.map(|(&from, _)| (from, Default::default()))
.collect(),
via: routers.iter().filter(|r| r.id != data.id).map(|r| (r.id, r.id)).collect(),
plan: BTreeMap::new(),
......@@ -76,6 +67,9 @@ impl Router {
}
pub fn offline(&mut self) {
if self.addr != None {
tracing::info!("router {} offline", self.id);
}
self.addr = None;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment