From 0d734b735f380c554da713100523a66b77f8fead Mon Sep 17 00:00:00 2001 From: Amelia Frost Date: Mon, 11 Mar 2024 17:35:10 -0700 Subject: [PATCH] Compile fix for error[E0277]: cannot multiply `f32` by `u32` --- crunchy-cli-core/src/utils/download.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crunchy-cli-core/src/utils/download.rs b/crunchy-cli-core/src/utils/download.rs index 2479a3e..320f2b9 100644 --- a/crunchy-cli-core/src/utils/download.rs +++ b/crunchy-cli-core/src/utils/download.rs @@ -1242,15 +1242,15 @@ fn write_ffmpeg_chapters( if event.start - last_end_time > 10.0 { writeln!(file, "[CHAPTER]")?; writeln!(file, "TIMEBASE=1/1000")?; - writeln!(file, "START={}", last_end_time * 1000u32)?; - writeln!(file, "END={}", event.start * 1000u32)?; + writeln!(file, "START={}", (last_end_time * 1000.0) as u32)?; + writeln!(file, "END={}", (event.start * 1000.0) as u32)?; writeln!(file, "title=Episode")?; } writeln!(file, "[CHAPTER]")?; writeln!(file, "TIMEBASE=1/1000")?; - writeln!(file, "START={}", event.start * 1000u32)?; - writeln!(file, "END={}", event.end * 1000u32)?; + writeln!(file, "START={}", (event.start * 1000.0) as u32)?; + writeln!(file, "END={}", (event.end * 1000.0) as u32)?; writeln!(file, "title={}", name)?; last_end_time = event.end; @@ -1261,8 +1261,8 @@ fn write_ffmpeg_chapters( if video_len - last_end_time > 10.0 { writeln!(file, "[CHAPTER]")?; writeln!(file, "TIMEBASE=1/1000")?; - writeln!(file, "START={}", last_end_time * 1000u32)?; - writeln!(file, "END={}", video_len * 1000u32)?; + writeln!(file, "START={}", (last_end_time * 1000.0) as u32)?; + writeln!(file, "END={}", (video_len * 1000.0) as u32)?; writeln!(file, "title=Episode")?; }