Also replace HashMap with LinkedHashMap to keep service order
This commit is contained in:
parent
94afceb6d0
commit
cd391a233d
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -220,6 +220,12 @@ version = "0.2.152"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
version = "0.5.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.20"
|
||||
@ -250,6 +256,7 @@ dependencies = [
|
||||
"graph-cycles",
|
||||
"hhmmss",
|
||||
"libc",
|
||||
"linked-hash-map",
|
||||
"nix",
|
||||
"petgraph",
|
||||
"serde",
|
||||
|
@ -12,6 +12,7 @@ daemonize = "0.5.0"
|
||||
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
toml = { version = "0.8.8", features = ["preserve_order"] }
|
||||
linked-hash-map = "0.5.6"
|
||||
shlex = "1.3.0"
|
||||
|
||||
petgraph = "0.6.4"
|
||||
|
@ -19,7 +19,7 @@ struct Data {
|
||||
pub epoll: nix::sys::epoll::Epoll,
|
||||
pub sigfd: nix::sys::signalfd::SignalFd,
|
||||
pub work_queue: Option<std::sync::mpsc::Sender<WorkItem>>,
|
||||
pub services: std::collections::HashMap<u64, service::Service>
|
||||
pub services: linked_hash_map::LinkedHashMap<u64, service::Service>
|
||||
}
|
||||
impl Data {
|
||||
fn new() -> Self {
|
||||
@ -35,7 +35,7 @@ impl Data {
|
||||
epoll,
|
||||
sigfd,
|
||||
work_queue: None,
|
||||
services: std::collections::HashMap::new()
|
||||
services: Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user