From 911e98d9ec28f10d066ff61080b49aa7b092d8f4 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 27 Jan 2022 10:21:53 -0600 Subject: [PATCH] Clean up example. --- speech-dispatcher/examples/list_voices.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/speech-dispatcher/examples/list_voices.rs b/speech-dispatcher/examples/list_voices.rs index e4b60f2..d9e3217 100644 --- a/speech-dispatcher/examples/list_voices.rs +++ b/speech-dispatcher/examples/list_voices.rs @@ -5,19 +5,19 @@ fn main() -> Result<(), Box> { let modules = connection.list_output_modules()?; println!("Modules available: {:?}", modules); - for module in modules.into_iter() { + for module in modules { if connection.set_output_module(&module).is_ok() { - println!("Listing voices for module {}", module); + println!("Listing voices for module {module}"); } else { - println!("Failed to set output module to {}", module); + println!("Failed to set output module to {module}"); continue; }; let voices = connection.list_synthesis_voices()?; - for voice in voices.into_iter() { - if let Some(variant) = voice.variant.as_deref() { + for voice in voices { + if let Some(variant) = voice.variant { println!( - " Name: {} / Language: {} / Variant: {}", - voice.name, voice.language, variant + " Name: {} / Language: {} / Variant: {variant}", + voice.name, voice.language ); } else { println!(" Name: {} / Language: {}", voice.name, voice.language);