@@ -67,7 +67,7 @@ impl ProcessingStats {
67
67
println ! ( " 🎵 Audio length: {:.2}s" , self . audio_length_seconds) ;
68
68
if self . audio_length_seconds > 0.0 {
69
69
let real_time_factor = self . total_duration . as_secs_f64 ( ) / self . audio_length_seconds as f64 ;
70
- println ! ( " ⚡ Real-time factor: {:.2}x" , real_time_factor ) ;
70
+ println ! ( " ⚡ Real-time factor: {real_time_factor :.2}x" ) ;
71
71
}
72
72
}
73
73
}
@@ -87,7 +87,7 @@ pub async fn transcribe_audio(
87
87
StatusCode :: BAD_REQUEST ,
88
88
Json ( ErrorResponse {
89
89
error : ErrorDetail {
90
- message : format ! ( "Failed to extract form data: {}" , e ) ,
90
+ message : format ! ( "Failed to extract form data: {e}" ) ,
91
91
error_type : "invalid_request_error" . to_string ( ) ,
92
92
param : Some ( "form" . to_string ( ) ) ,
93
93
code : None ,
@@ -97,7 +97,7 @@ pub async fn transcribe_audio(
97
97
} ,
98
98
} ;
99
99
100
- println ! ( "Request params: {:?}" , params ) ;
100
+ println ! ( "Request params: {params :?}" ) ;
101
101
102
102
// Parse streaming parameter from form data
103
103
let stream_enabled = params
@@ -107,11 +107,10 @@ pub async fn transcribe_audio(
107
107
108
108
// Get model name from parameters and clone it to make it owned
109
109
let model_name = params
110
- . get ( "model" )
111
- . map ( |s| s. clone ( ) ) // Clone to make it owned
110
+ . get ( "model" ) . cloned ( ) // Clone to make it owned
112
111
. unwrap_or_else ( || "tiny" . to_string ( ) ) ; // Use tiny as default
113
112
114
- println ! ( "Using model: {}, streaming: {}" , model_name , stream_enabled ) ;
113
+ println ! ( "Using model: {model_name }, streaming: {stream_enabled}" ) ;
115
114
116
115
// Convert audio to PCM format with timing
117
116
let conversion_start = Instant :: now ( ) ;
@@ -122,7 +121,7 @@ pub async fn transcribe_audio(
122
121
StatusCode :: BAD_REQUEST ,
123
122
Json ( ErrorResponse {
124
123
error : ErrorDetail {
125
- message : format ! ( "Failed to process audio file: {}" , e ) ,
124
+ message : format ! ( "Failed to process audio file: {e}" ) ,
126
125
error_type : "invalid_request_error" . to_string ( ) ,
127
126
param : Some ( "file" . to_string ( ) ) ,
128
127
code : None ,
@@ -156,7 +155,7 @@ pub async fn transcribe_audio(
156
155
StatusCode :: INTERNAL_SERVER_ERROR ,
157
156
Json ( ErrorResponse {
158
157
error : ErrorDetail {
159
- message : format ! ( "Transcription failed: {}" , e ) ,
158
+ message : format ! ( "Transcription failed: {e}" ) ,
160
159
error_type : "server_error" . to_string ( ) ,
161
160
param : None ,
162
161
code : None ,
@@ -321,7 +320,7 @@ async fn create_transcription_stream(
321
320
StatusCode :: BAD_REQUEST ,
322
321
Json ( ErrorResponse {
323
322
error : ErrorDetail {
324
- message : format ! ( "Failed to load model '{}': {}" , model_name , e ) ,
323
+ message : format ! ( "Failed to load model '{model_name }': {e}" ) ,
325
324
error_type : "invalid_request_error" . to_string ( ) ,
326
325
param : Some ( "model" . to_string ( ) ) ,
327
326
code : None ,
0 commit comments