From 822f770ab8e7acc547e9df955e0d1967cb42b322 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 31 Mar 2022 13:25:08 -0500 Subject: [PATCH] Finish making gender optional. --- Cargo.toml | 1 - src/backends/speech_dispatcher.rs | 4 ++-- src/backends/web.rs | 6 ++---- src/backends/winrt.rs | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eccc258..c7447cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,6 @@ crate-type = ["lib", "cdylib", "staticlib"] [features] speech_dispatcher_0_10 = ["speech-dispatcher/0_10"] -default = ["speech_dispatcher_0_10"] [dependencies] dyn-clonable = "0.9" diff --git a/src/backends/speech_dispatcher.rs b/src/backends/speech_dispatcher.rs index 12ea534..b3034a1 100644 --- a/src/backends/speech_dispatcher.rs +++ b/src/backends/speech_dispatcher.rs @@ -6,7 +6,7 @@ use log::{info, trace}; use speech_dispatcher::*; use unic_langid::LanguageIdentifier; -use crate::{Backend, BackendId, Error, Features, Gender, UtteranceId, Voice, CALLBACKS}; +use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS}; #[derive(Clone, Debug)] pub(crate) struct SpeechDispatcher(Connection); @@ -191,7 +191,7 @@ impl Backend for SpeechDispatcher { .map(|v| Voice { id: v.name.clone(), name: v.name.clone(), - gender: Gender::Unspecified, + gender: None, language: LanguageIdentifier::from_str(&v.language).unwrap(), }) .collect::>(); diff --git a/src/backends/web.rs b/src/backends/web.rs index a39dff2..578a213 100644 --- a/src/backends/web.rs +++ b/src/backends/web.rs @@ -11,9 +11,7 @@ use web_sys::{ SpeechSynthesisUtterance, SpeechSynthesisVoice, }; -use crate::Gender; -use crate::Voice; -use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS}; +use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS}; #[derive(Clone, Debug)] pub struct Web { @@ -270,7 +268,7 @@ impl From for Voice { Voice { id: other.voice_uri(), name: other.name(), - gender: Gender::Unspecified, + gender: None, language, } } diff --git a/src/backends/winrt.rs b/src/backends/winrt.rs index 97bd130..ceb5f00 100644 --- a/src/backends/winrt.rs +++ b/src/backends/winrt.rs @@ -354,7 +354,7 @@ impl TryInto for VoiceInformation { Ok(Voice { id: self.Id()?.try_into()?, name: self.DisplayName()?.try_into()?, - gender, + gender: Some(gender), language, }) }