From ce93a13304d1500b7b3b51a1ed35e30d3da1e83e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 10 Jan 2023 22:46:47 +0000 Subject: [PATCH] Config inspection: tidying Signed-off-by: Ian Jackson --- client/client.rs | 10 ++++++---- server/server.rs | 4 ++-- src/config.rs | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/client.rs b/client/client.rs index 06643f0..cc8db31 100644 --- a/client/client.rs +++ b/client/client.rs @@ -336,10 +336,12 @@ async fn run_client( #[tokio::main] async fn main() { let opts = ::parse(); - let (ics,) = config::startup("hippotat", LinkEnd::Client, - &opts.config, &opts.log, |_, ics| { - PrintConfigOpt(&&opts.print_config) - .implement(&mut ics.iter(), )?; + let (ics,) = config::startup( + "hippotat", LinkEnd::Client, + &opts.config, &opts.log, |_, ics| + { + PrintConfigOpt(&opts.print_config) + .implement(&ics, )?; Ok((ics,)) }); diff --git a/server/server.rs b/server/server.rs index 44dbad6..8498d25 100644 --- a/server/server.rs +++ b/server/server.rs @@ -179,9 +179,9 @@ async fn async_main(opts: Opts, daemon: Option) { let gc = (&server_name, &global_config); if pc.keys().all(|k| gc.inspect_key(k).is_some()) { - pc.implement(&mut iter::once(&gc))?; + pc.implement([&gc])?; } else { - pc.implement(&mut ics.iter())?; + pc.implement(&ics)?; } } diff --git a/src/config.rs b/src/config.rs index 026359c..447e67f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -128,7 +128,7 @@ impl PrintConfigOpt<'_> { #[throws(AE)] pub fn implement<'c, C: InspectableConfig + 'c>( self, - configs: impl Iterator, + configs: impl IntoIterator, ) { if let Some(arg) = self.0 { for config in configs { -- 2.30.2