mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-23 07:09:37 +00:00
Eliminate some Clippy warnings.
This commit is contained in:
parent
ace5d2fd1f
commit
dbac8a3fe0
|
@ -56,8 +56,8 @@ impl WinRT {
|
||||||
let mut rv = Self {
|
let mut rv = Self {
|
||||||
id: bid,
|
id: bid,
|
||||||
synth: SpeechSynthesizer::new()?,
|
synth: SpeechSynthesizer::new()?,
|
||||||
player: player,
|
player,
|
||||||
playback_list: playback_list,
|
playback_list,
|
||||||
};
|
};
|
||||||
*backend_id += 1;
|
*backend_id += 1;
|
||||||
Self::init_callbacks(&mut rv)?;
|
Self::init_callbacks(&mut rv)?;
|
||||||
|
|
|
@ -190,8 +190,7 @@ impl TTS {
|
||||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||||
Backends::AvFoundation => Ok(TTS(Box::new(backends::AvFoundation::new()))),
|
Backends::AvFoundation => Ok(TTS(Box::new(backends::AvFoundation::new()))),
|
||||||
};
|
};
|
||||||
if backend.is_ok() {
|
if let Ok(backend) = backend {
|
||||||
let backend = backend.unwrap();
|
|
||||||
if let Some(id) = backend.0.id() {
|
if let Some(id) = backend.0.id() {
|
||||||
let mut callbacks = CALLBACKS.lock().unwrap();
|
let mut callbacks = CALLBACKS.lock().unwrap();
|
||||||
callbacks.insert(id, Callbacks::default());
|
callbacks.insert(id, Callbacks::default());
|
||||||
|
@ -206,7 +205,7 @@ impl TTS {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let tts = TTS::new(Backends::SpeechDispatcher);
|
let tts = TTS::new(Backends::SpeechDispatcher);
|
||||||
#[cfg(windows)]
|
#[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)
|
Ok(tts)
|
||||||
} else {
|
} else {
|
||||||
TTS::new(Backends::WinRT)
|
TTS::new(Backends::WinRT)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user