mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 12:39:36 +00:00
Add Default
implementation for Features
so backends need only specify features they actually support.
This commit is contained in:
parent
951e31b284
commit
1507527175
|
@ -95,9 +95,9 @@ impl Backend for AppKit {
|
|||
Features {
|
||||
stop: true,
|
||||
rate: true,
|
||||
pitch: false,
|
||||
volume: true,
|
||||
is_speaking: true,
|
||||
..Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,7 @@ impl Backend for Tolk {
|
|||
fn supported_features(&self) -> Features {
|
||||
Features {
|
||||
stop: true,
|
||||
rate: false,
|
||||
pitch: false,
|
||||
volume: false,
|
||||
is_speaking: false,
|
||||
..Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -48,6 +48,18 @@ pub struct Features {
|
|||
pub is_speaking: bool,
|
||||
}
|
||||
|
||||
impl Default for Features {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
stop: false,
|
||||
rate: false,
|
||||
pitch: false,
|
||||
volume: false,
|
||||
is_speaking: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("IO error: {0}")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user