Clean up example.

This commit is contained in:
Nolan Darilek 2022-01-27 10:21:53 -06:00
parent 8434bfca64
commit 911e98d9ec
1 changed files with 7 additions and 7 deletions

View File

@ -5,19 +5,19 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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);