And of course Cargo complains about my feature name only at publication time. Fixed.

This commit is contained in:
Nolan Darilek 2022-03-10 13:27:50 -06:00
parent 0ba2937a8a
commit 8c69d78411
2 changed files with 9 additions and 9 deletions

View File

@ -8,8 +8,8 @@ license = "LGPL-2.1 OR MIT OR Apache-2.0"
edition = "2021" edition = "2021"
[features] [features]
"0.10" = [] 0_10 = []
default = ["0.10"] default = ["0_10"]
[dependencies] [dependencies]
lazy_static = "1" lazy_static = "1"

View File

@ -98,7 +98,7 @@ pub enum Notification {
#[repr(u32)] #[repr(u32)]
pub enum Punctuation { pub enum Punctuation {
All = SPDPunctuation::SPD_PUNCT_ALL, All = SPDPunctuation::SPD_PUNCT_ALL,
#[cfg(feature = "0.10")] #[cfg(feature = "0_10")]
Most = SPDPunctuation::SPD_PUNCT_MOST, Most = SPDPunctuation::SPD_PUNCT_MOST,
Some = SPDPunctuation::SPD_PUNCT_SOME, Some = SPDPunctuation::SPD_PUNCT_SOME,
None = SPDPunctuation::SPD_PUNCT_NONE, None = SPDPunctuation::SPD_PUNCT_NONE,
@ -413,25 +413,25 @@ impl Connection {
} }
pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> { pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(feature = "0.10")] #[cfg(feature = "0_10")]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) }; let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
#[cfg(not(feature = "0.10"))] #[cfg(not(feature = "0_10"))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) }; let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) };
c_int_to_result(v) c_int_to_result(v)
} }
pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> { pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(feature = "0.10")] #[cfg(feature = "0_10")]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) }; let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
#[cfg(not(feature = "0.10"))] #[cfg(not(feature = "0_10"))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) }; let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) };
c_int_to_result(v) c_int_to_result(v)
} }
pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> { pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> {
#[cfg(feature = "0.10")] #[cfg(feature = "0_10")]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) }; let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
#[cfg(not(feature = "0.10"))] #[cfg(not(feature = "0_10"))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) }; let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) };
c_int_to_result(v) c_int_to_result(v)
} }