Eliminate Clippy warnings.

This commit is contained in:
Nolan Darilek 2020-11-17 19:43:57 -06:00
parent b34c880a36
commit e2c1bfa7c9

View File

@ -14,6 +14,7 @@ impl Utterance {
} }
} }
#[allow(clippy::enum_variant_names)]
enum Msg { enum Msg {
UtteranceBegin(UtteranceId), UtteranceBegin(UtteranceId),
UtteranceEnd(UtteranceId), UtteranceEnd(UtteranceId),
@ -121,13 +122,7 @@ impl TTS {
.done(); .done();
builder builder
.add_property("can_detect_screen_reader") .add_property("can_detect_screen_reader")
.with_getter(|_: &TTS, _| { .with_getter(|_: &TTS, _| cfg!(all(windows, features = "use_tolk")))
if cfg!(all(windows, features = "use_tolk")) {
true
} else {
false
}
})
.done(); .done();
#[allow(unreachable_code)] #[allow(unreachable_code)]
builder builder
@ -148,7 +143,7 @@ impl TTS {
is_speaking: is_speaking_supported, is_speaking: is_speaking_supported,
.. ..
} = this.0.supported_features(); } = this.0.supported_features();
return is_speaking_supported; is_speaking_supported
}) })
.done(); .done();
builder builder
@ -159,9 +154,9 @@ impl TTS {
.. ..
} = this.0.supported_features(); } = this.0.supported_features();
if is_speaking_supported { if is_speaking_supported {
return this.0.is_speaking().unwrap(); this.0.is_speaking().unwrap()
} else { } else {
return false; false
} }
}) })
.done(); .done();
@ -204,8 +199,7 @@ impl TTS {
.map_mut(|u, _| u.0 = id) .map_mut(|u, _| u.0 = id)
.expect("Failed to set utterance ID"); .expect("Failed to set utterance ID");
} }
let utterance = utterance.owned_to_variant(); utterance.owned_to_variant()
utterance
} else { } else {
Variant::default() Variant::default()
} }
@ -236,7 +230,7 @@ impl TTS {
#[export] #[export]
fn _process(&mut self, owner: &Node, _delta: f32) { fn _process(&mut self, owner: &Node, _delta: f32) {
if let Some(msg) = self.1.try_recv().ok() { if let Ok(msg) = self.1.try_recv() {
match msg { match msg {
Msg::UtteranceBegin(utterance_id) => { Msg::UtteranceBegin(utterance_id) => {
let utterance: Instance<Utterance, Unique> = Instance::new(); let utterance: Instance<Utterance, Unique> = Instance::new();