Remove ports when they're unconfigured

This is closer to what I had intended
This commit is contained in:
John Doty 2022-11-28 07:03:04 -08:00
parent 46c9643ddf
commit abbb30d87b
2 changed files with 5 additions and 4 deletions

View file

@ -15,6 +15,10 @@ pub struct ServerConfig {
}
impl ServerConfig {
pub fn contains_key(&self, port: u16) -> bool {
self.ports.contains_key(&port)
}
pub fn get(&self, port: u16) -> PortConfig {
match self.ports.get(&port) {
None => PortConfig { enabled: self.auto, description: None },