From 80589fb9c08e3c15b31db51c7a40767ff6fbf33d Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 4 Feb 2020 22:58:37 +0100 Subject: Move source names inside the source sections. This means that the order of the sources is preserved. --- src/manager/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/manager/mod.rs') diff --git a/src/manager/mod.rs b/src/manager/mod.rs index b7fb8c2..d4799a7 100644 --- a/src/manager/mod.rs +++ b/src/manager/mod.rs @@ -9,7 +9,6 @@ use std::path::PathBuf; use std::time::{Duration, Instant, SystemTime}; struct Source { - name: String, config: config::Source, data: proto::Source, next_update: Instant, @@ -50,8 +49,8 @@ impl Manager { let _ = m.current_load(); - for (name, cfg) in c.sources { - m.add_source(name, cfg)?; + for cfg in c.sources { + m.add_source(cfg)?; } Ok(m) @@ -92,9 +91,8 @@ impl Manager { } } - fn add_source(&mut self, name: String, config: config::Source) -> io::Result<()> { + fn add_source(&mut self, config: config::Source) -> io::Result<()> { let mut s = Source { - name, config, data: proto::Source::empty(), next_update: Instant::now(), -- cgit