Clean up example.

This commit is contained in:
Nolan Darilek 2022-01-27 10:21:53 -06:00
parent 8434bfca64
commit 911e98d9ec

View File

@ -5,19 +5,19 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let modules = connection.list_output_modules()?; let modules = connection.list_output_modules()?;
println!("Modules available: {:?}", modules); println!("Modules available: {:?}", modules);
for module in modules.into_iter() { for module in modules {
if connection.set_output_module(&module).is_ok() { if connection.set_output_module(&module).is_ok() {
println!("Listing voices for module {}", module); println!("Listing voices for module {module}");
} else { } else {
println!("Failed to set output module to {}", module); println!("Failed to set output module to {module}");
continue; continue;
}; };
let voices = connection.list_synthesis_voices()?; let voices = connection.list_synthesis_voices()?;
for voice in voices.into_iter() { for voice in voices {
if let Some(variant) = voice.variant.as_deref() { if let Some(variant) = voice.variant {
println!( println!(
" Name: {} / Language: {} / Variant: {}", " Name: {} / Language: {} / Variant: {variant}",
voice.name, voice.language, variant voice.name, voice.language
); );
} else { } else {
println!(" Name: {} / Language: {}", voice.name, voice.language); println!(" Name: {} / Language: {}", voice.name, voice.language);