Skip to content

Commit

Permalink
refactor: flat is better than nested
Browse files Browse the repository at this point in the history
  • Loading branch information
kxxt committed Jun 27, 2023
1 parent 63a8b51 commit 700dbbf
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/01-synthesize-txt-files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use tokio::{
};

use aspeak::{
synthesizer::{RestSynthesizer, SynthesizerConfig},
AudioFormat, AuthOptionsBuilder, TextOptions, TextOptionsBuilder,
AudioFormat, AuthOptionsBuilder, RestSynthesizer, SynthesizerConfig, TextOptions,
TextOptionsBuilder,
};

#[tokio::main(flavor = "current_thread")]
Expand Down
3 changes: 1 addition & 2 deletions examples/02-rssl.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::{env, error::Error};

use aspeak::{
synthesizer::SynthesizerConfig, AudioFormat, AuthOptionsBuilder, RichSsmlOptionsBuilder,
TextOptionsBuilder,
AudioFormat, AuthOptionsBuilder, RichSsmlOptionsBuilder, SynthesizerConfig, TextOptionsBuilder,
};
use rodio::{Decoder, OutputStream, Sink};
use rustyline::error::ReadlineError;
Expand Down
2 changes: 1 addition & 1 deletion examples/03-rest-synthesizer-simple.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use aspeak::{
get_rest_endpoint_by_region, synthesizer::SynthesizerConfig, AudioFormat, AuthOptionsBuilder,
get_rest_endpoint_by_region, AudioFormat, AuthOptionsBuilder, SynthesizerConfig,
TextOptionsBuilder,
};

Expand Down
2 changes: 1 addition & 1 deletion examples/04-websocket-synthesizer-simple.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use aspeak::{
get_websocket_endpoint_by_region, synthesizer::SynthesizerConfig, AudioFormat, AuthOptionsBuilder,
get_websocket_endpoint_by_region, AudioFormat, AuthOptionsBuilder, SynthesizerConfig,
TextOptionsBuilder,
};

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ mod net;
mod parse;
mod ssml;
pub mod synthesizer;
pub use synthesizer::*;
mod types;
mod utils;
pub mod voice;
pub use voice::*;

/// Get the official websocket endpoint by its region (e.g. `eastus`)
pub fn get_websocket_endpoint_by_region(region: &str) -> String {
Expand All @@ -127,7 +129,6 @@ pub use auth::*;
use phf::phf_map;
pub use ssml::*;
pub use types::*;
pub use voice::Voice;

#[cfg(feature = "python")]
pub mod python;
Expand Down
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use std::{
use cli::{commands::Command, Cli};

use aspeak::{
synthesizer::{SynthesizerConfig, UnifiedSynthesizer},
voice::{VoiceListAPIAuth, VoiceListAPIEndpoint, VoiceListAPIError, VoiceListAPIErrorKind},
AudioFormat, Voice, QUALITY_MAP,
AudioFormat, SynthesizerConfig, UnifiedSynthesizer, Voice, VoiceListAPIAuth,
VoiceListAPIEndpoint, VoiceListAPIError, VoiceListAPIErrorKind, QUALITY_MAP,
};
use clap::Parser;
use color_eyre::{
Expand Down

0 comments on commit 700dbbf

Please sign in to comment.