Simplify if conditional in audio_transcription example

This commit is contained in:
Niko 2025-08-15 23:38:03 -07:00
parent b07d20a3c1
commit c327ec699b
No known key found for this signature in database

View file

@ -110,15 +110,7 @@ fn main() -> Result<(), &'static str> {
let start_timestamp = segment.start_timestamp(); let start_timestamp = segment.start_timestamp();
let end_timestamp = segment.end_timestamp(); let end_timestamp = segment.end_timestamp();
let first_token_dtw_ts = if segment.n_tokens() > 0 { let first_token_dtw_ts = segment.get_token(0).map_or(-1, |t| t.token_data().t_dtw);
if let Some(token) = segment.get_token(0) {
token.token_data().t_dtw
} else {
-1i64
}
} else {
-1i64
};
// Print the segment to stdout. // Print the segment to stdout.
println!( println!(
"[{} - {} ({})]: {}", "[{} - {} ({})]: {}",