1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-07-22 05:39:36 +00:00

Eliminate some Clippy warnings.

This commit is contained in:
Nolan Darilek 2020-09-26 12:43:16 -05:00
parent ace5d2fd1f
commit dbac8a3fe0
2 changed files with 4 additions and 5 deletions

View File

@ -56,8 +56,8 @@ impl WinRT {
let mut rv = Self {
id: bid,
synth: SpeechSynthesizer::new()?,
player: player,
playback_list: playback_list,
player,
playback_list,
};
*backend_id += 1;
Self::init_callbacks(&mut rv)?;

View File

@ -190,8 +190,7 @@ impl TTS {
#[cfg(any(target_os = "macos", target_os = "ios"))]
Backends::AvFoundation => Ok(TTS(Box::new(backends::AvFoundation::new()))),
};
if backend.is_ok() {
let backend = backend.unwrap();
if let Ok(backend) = backend {
if let Some(id) = backend.0.id() {
let mut callbacks = CALLBACKS.lock().unwrap();
callbacks.insert(id, Callbacks::default());
@ -206,7 +205,7 @@ impl TTS {
#[cfg(target_os = "linux")]
let tts = TTS::new(Backends::SpeechDispatcher);
#[cfg(windows)]
let tts = if let Some(tts) = TTS::new(Backends::Tolk).ok() {
let tts = if let Ok(tts) = TTS::new(Backends::Tolk) {
Ok(tts)
} else {
TTS::new(Backends::WinRT)