cargo fmt

This commit is contained in:
Nolan Darilek 2022-03-30 10:18:22 -05:00
parent 6057d9c968
commit c222c087b2
10 changed files with 41 additions and 37 deletions

View File

@ -9,8 +9,8 @@ use log::{info, trace};
use objc::runtime::{Object, Sel};
use objc::{class, declare::ClassDecl, msg_send, sel, sel_impl};
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
use crate::voices::Backend as VoiceBackend;
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
mod voices;
use voices::*;
@ -285,7 +285,10 @@ impl Backend for AvFoundation {
}
fn list_voices(&self) -> Vec<String> {
AVSpeechSynthesisVoice::list().iter().map(|v| {v.id()}).collect()
AVSpeechSynthesisVoice::list()
.iter()
.map(|v| v.id())
.collect()
}
fn set_voice(&mut self, voice: &str) -> Result<(), Error> {

View File

@ -1,10 +1,9 @@
use cocoa_foundation::base::{id, nil};
use cocoa_foundation::foundation::NSString;
use core_foundation::array::CFArray;
use core_foundation::string::CFString;
use objc::runtime::*;
use objc::*;
use core_foundation::array::CFArray;
use cocoa_foundation::foundation::NSString;
use cocoa_foundation::base::{nil,id};
use core_foundation::string::CFString;
use crate::backends::AvFoundation;
use crate::voices;
@ -36,9 +35,12 @@ impl voices::Backend for AVSpeechSynthesisVoice {
fn list() -> Vec<Self> {
let voices: CFArray = unsafe { msg_send![class!(AVSpeechSynthesisVoice), speechVoices] };
voices.iter().map(|v| {
AVSpeechSynthesisVoice{0: *v as *const Object}
}).collect()
voices
.iter()
.map(|v| AVSpeechSynthesisVoice {
0: *v as *const Object,
})
.collect()
}
fn name(self) -> String {

View File

@ -1,4 +1,3 @@
pub use unic_langid::LanguageIdentifier;
pub enum Gender {