Skip to content

Commit 6f50cea

Browse files
committed
lint
1 parent 7c633bf commit 6f50cea

File tree

8 files changed

+95
-89
lines changed

8 files changed

+95
-89
lines changed

Cargo.toml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,44 @@ resolver = "2"
33

44
members = [
55
"llm/llm",
6-
# "llm/bedrock",
7-
# "llm/anthropic",
8-
# "llm/grok",
9-
# "llm/ollama",
10-
# "llm/openai",
11-
# "llm/openrouter",
12-
# "embed/embed",
13-
# "embed/cohere",
14-
# "embed/hugging-face",
15-
# "embed/openai",
16-
# "embed/voyageai",
17-
# "websearch/websearch",
18-
# "websearch/brave",
19-
# "websearch/google",
20-
# "websearch/serper",
21-
# "websearch/tavily",
22-
# "search/search",
23-
# "search/elasticsearch",
24-
# "search/algolia",
25-
# "search/meilisearch",
26-
# "search/opensearch",
27-
# "search/typesense",
28-
# "graph/graph",
29-
# "graph/arangodb",
30-
# "graph/janusgraph",
31-
# "graph/neo4j",
32-
# "video/video",
33-
# "video/kling",
34-
# "video/runway",
35-
# "video/veo",
36-
# "video/stability",
37-
# "exec/exec",
38-
# "stt/stt",
39-
# "stt/whisper",
40-
# "stt/deepgram",
41-
# "stt/aws",
42-
# "stt/azure",
43-
# "stt/google",
6+
"llm/bedrock",
7+
"llm/anthropic",
8+
"llm/grok",
9+
"llm/ollama",
10+
"llm/openai",
11+
"llm/openrouter",
12+
"embed/embed",
13+
"embed/cohere",
14+
"embed/hugging-face",
15+
"embed/openai",
16+
"embed/voyageai",
17+
"websearch/websearch",
18+
"websearch/brave",
19+
"websearch/google",
20+
"websearch/serper",
21+
"websearch/tavily",
22+
"search/search",
23+
"search/elasticsearch",
24+
"search/algolia",
25+
"search/meilisearch",
26+
"search/opensearch",
27+
"search/typesense",
28+
"graph/graph",
29+
"graph/arangodb",
30+
"graph/janusgraph",
31+
"graph/neo4j",
32+
"video/video",
33+
"video/kling",
34+
"video/runway",
35+
"video/veo",
36+
"video/stability",
37+
"exec/exec",
38+
"stt/stt",
39+
"stt/whisper",
40+
"stt/deepgram",
41+
"stt/aws",
42+
"stt/azure",
43+
"stt/google",
4444
"tts/tts",
4545
"tts/elevenlabs",
4646
"tts/polly",

tts/deepgram/src/lib.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ impl AdvancedGuest for DeepgramComponent {
127127
) -> Result<LongFormOperation, TtsError> {
128128
let deepgram = Deepgram::new()?;
129129
let voice_canonical_name = voice.name.clone(); // Use canonical name
130-
let operation = deepgram.synthesize_long_form(
131-
content,
132-
voice_canonical_name,
133-
chapter_breaks,
134-
)?;
130+
let operation =
131+
deepgram.synthesize_long_form(content, voice_canonical_name, chapter_breaks)?;
135132
Ok(LongFormOperation::new(operation))
136133
}
137134
}
@@ -174,13 +171,8 @@ impl ExtendedAdvancedTrait for DeepgramComponent {
174171
) -> Result<Self::LongFormOperation, golem_tts::golem::tts::types::TtsError> {
175172
let client = Deepgram::new()?;
176173
let voice_canonical_name = voice.name.clone(); // Use canonical name
177-
client.synthesize_long_form(
178-
content,
179-
voice_canonical_name,
180-
chapter_breaks,
181-
)
174+
client.synthesize_long_form(content, voice_canonical_name, chapter_breaks)
182175
}
183-
184176
}
185177

186178
type DurableDeepgramComponent = DurableTTS<DeepgramComponent>;

tts/google/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ impl AdvancedGuest for GoogleTtsComponent {
143143
) -> Result<LongFormOperation, TtsError> {
144144
let google = Google::new()?;
145145
let voice_name = voice.id.clone();
146-
let operation =
147-
google.synthesize_long_form(content, voice_name, chapter_breaks)?;
146+
let operation = google.synthesize_long_form(content, voice_name, chapter_breaks)?;
148147
Ok(LongFormOperation::new(operation))
149148
}
150149
}

tts/polly/src/aws_signer.rs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ impl PollySigner {
6363
let date_stamp = timestamp.format("%Y%m%d").to_string();
6464
let amz_date = timestamp.format("%Y%m%dT%H%M%SZ").to_string();
6565

66-
parts
67-
.headers
68-
.insert("x-amz-date", HeaderValue::from_str(&amz_date)
69-
.map_err(|e| TtsError::InternalError(format!("Invalid header value: {}", e)))?);
66+
parts.headers.insert(
67+
"x-amz-date",
68+
HeaderValue::from_str(&amz_date)
69+
.map_err(|e| TtsError::InternalError(format!("Invalid header value: {}", e)))?,
70+
);
7071

7172
let content_sha256 = self.hash_payload(body.as_ref());
7273
parts.headers.insert(
@@ -91,8 +92,12 @@ impl PollySigner {
9192
host.to_string()
9293
};
9394

94-
headers_for_signing.insert("host", HeaderValue::from_str(&host_header)
95-
.map_err(|e| TtsError::InternalError(format!("Invalid header value: {}", e)))?);
95+
headers_for_signing.insert(
96+
"host",
97+
HeaderValue::from_str(&host_header).map_err(|e| {
98+
TtsError::InternalError(format!("Invalid header value: {}", e))
99+
})?,
100+
);
96101
}
97102
}
98103

@@ -116,10 +121,11 @@ impl PollySigner {
116121
"AWS4-HMAC-SHA256 Credential={credential}, SignedHeaders={signed_headers}, Signature={signature}"
117122
);
118123

119-
parts
120-
.headers
121-
.insert("authorization", HeaderValue::from_str(&authorization)
122-
.map_err(|e| TtsError::InternalError(format!("Invalid header value: {}", e)))?);
124+
parts.headers.insert(
125+
"authorization",
126+
HeaderValue::from_str(&authorization)
127+
.map_err(|e| TtsError::InternalError(format!("Invalid header value: {}", e)))?,
128+
);
123129

124130
Ok(Request::from_parts(parts, body))
125131
}
@@ -253,7 +259,11 @@ impl PollySigner {
253259
string_to_sign
254260
}
255261

256-
fn calculate_signature(&self, string_to_sign: &str, date_stamp: &str) -> Result<String, TtsError> {
262+
fn calculate_signature(
263+
&self,
264+
string_to_sign: &str,
265+
date_stamp: &str,
266+
) -> Result<String, TtsError> {
257267
let secret = format!("AWS4{}", self.secret_key);
258268

259269
let mut mac = HmacSha256::new_from_slice(secret.as_bytes())

tts/polly/src/polly.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl TtsClient for Polly {
7575
region,
7676
base_url,
7777
signer,
78-
bucket: bucket,
78+
bucket,
7979
})
8080
}
8181

tts/polly/src/resources.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ impl From<String> for AwsLongFormOperation {
166166
SynthesisTask {
167167
task_id: value,
168168
creation_time: 0.0,
169-
engine:String::new(),
170-
output_format:String::new(),
171-
task_status:String::new(),
172-
task_status_reason:None,
169+
engine: String::new(),
170+
output_format: String::new(),
171+
task_status: String::new(),
172+
task_status_reason: None,
173173
output_uri: None,
174-
request_characters:0,
174+
request_characters: 0,
175175
voice_id: String::new(),
176176
},
177177
"".to_string(),

tts/tts/src/durability/advanced.rs

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ mod durability_impl {
9090

9191
use crate::{
9292
durability::{DurableTTS, ExtendedAdvancedTrait},
93-
golem::tts::{advanced::{
94-
AudioSample, Guest, GuestLongFormOperation, GuestPronunciationLexicon, LanguageCode,
95-
LongFormOperation, LongFormResult, OperationStatus, PronunciationEntry,
96-
PronunciationLexicon, TtsError, Voice, VoiceDesignParams,
97-
}, types::SynthesisMetadata},
93+
golem::tts::{
94+
advanced::{
95+
AudioSample, Guest, GuestLongFormOperation, GuestPronunciationLexicon,
96+
LanguageCode, LongFormOperation, LongFormResult, OperationStatus,
97+
PronunciationEntry, PronunciationLexicon, TtsError, Voice, VoiceDesignParams,
98+
},
99+
types::SynthesisMetadata,
100+
},
98101
init_logging,
99102
};
100103

@@ -363,6 +366,7 @@ mod durability_impl {
363366
}
364367
}
365368

369+
#[allow(clippy::large_enum_variant)]
366370
enum DurableLongFormOperationState<Impl: Guest> {
367371
Live {
368372
operation: Impl::LongFormOperation,
@@ -491,7 +495,7 @@ mod durability_impl {
491495
Some(task_id.clone()),
492496
)?;
493497

494-
(status.clone(), Some(new_longform_synthesis))
498+
(*status, Some(new_longform_synthesis))
495499
}
496500
_ => unreachable!(),
497501
}
@@ -505,14 +509,14 @@ mod durability_impl {
505509
});
506510
}
507511

508-
let _ = durability.persist_infallible(NoInput, status.clone());
512+
let _ = durability.persist_infallible(NoInput, status);
509513
Ok(status)
510514
} else {
511515
let replay: OperationStatus = durability.replay_infallible();
512516
let mut state = self.state.borrow_mut();
513517
match &mut *state {
514518
Some(DurableLongFormOperationState::Replay { status, .. }) => {
515-
*status = replay.clone();
519+
*status = replay;
516520
}
517521
_ => {
518522
unreachable!()
@@ -553,7 +557,7 @@ mod durability_impl {
553557
Some(task_id.clone()),
554558
)?;
555559

556-
(progress.clone(), Some(new_longform_synthesis))
560+
(*progress, Some(new_longform_synthesis))
557561
}
558562
_ => unreachable!(),
559563
}
@@ -837,24 +841,25 @@ mod durability_impl {
837841
);
838842
init_logging();
839843
if durability.is_live() {
840-
let longform_operation = with_persistence_level(PersistenceLevel::PersistNothing, || {
841-
Impl::unwrappered_synthesize_long_form(
842-
content.clone(),
843-
voice.clone(),
844-
chapter_breaks.clone(),
845-
None,
846-
)
847-
})?;
844+
let longform_operation =
845+
with_persistence_level(PersistenceLevel::PersistNothing, || {
846+
Impl::unwrappered_synthesize_long_form(
847+
content.clone(),
848+
voice.clone(),
849+
chapter_breaks.clone(),
850+
None,
851+
)
852+
})?;
848853

849854
let task_id = with_persistence_level(PersistenceLevel::PersistNothing, || {
850855
longform_operation.get_task_id()
851856
})?;
852857

853858
let _ = durability.persist_infallible(NoInput, task_id.clone());
854859

855-
Ok(LongFormOperation::new(DurableLongFormOperation::<Impl>::live(
856-
longform_operation,
857-
)))
860+
Ok(LongFormOperation::new(
861+
DurableLongFormOperation::<Impl>::live(longform_operation),
862+
))
858863
} else {
859864
let task_id: String = durability.replay_infallible();
860865

tts/tts/src/durability/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub trait ExtendedAdvancedTrait: AdvancedTrait + 'static {
3333
content: String,
3434
voice: Voice,
3535
chapter_breaks: Option<Vec<u32>>,
36-
task_id:Option<String>,
36+
task_id: Option<String>,
3737
) -> Result<Self::LongFormOperation, TtsError>;
3838
}
3939

0 commit comments

Comments
 (0)