From 2de23178315abb33245a1462409d0d647dc2b1b4 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 15 Oct 2022 13:46:20 +0200 Subject: [PATCH] fix a few clippy warns and disable expect_fun_call warn --- src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9464f1d..18bfefb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,6 @@ +#![allow(clippy::expect_fun_call)] // I don't see a reason for this warn + + mod frame; use crate::frame::Frame; @@ -97,11 +100,10 @@ async fn send_video(message: Message, ctx: Context) { tokio::time::sleep(Duration::from_millis( 5000 - (unix_millis() - sa) + (api_time as i64 - * i64::from_str_radix( + * str::parse::( env::var("PROJBOTV3_API_TIME_FACTOR") - .unwrap_or("3".into()) - .as_str(), - 10, + .unwrap_or_else(|_| "3".into()) + .as_str() ) .unwrap()) as u64, )) @@ -253,7 +255,7 @@ async fn main() { // If vid_encoded doesn't exist, convert vid.mp4 into vid_encoded if !Path::new("vid_encoded/").is_dir() { println!("encode: encoding video..."); - if let Ok(_) = fs::create_dir("vid") { + if fs::create_dir("vid").is_ok() { // We're using ffmpeg commands because ffmpeg's api is a hunk of junk let mut command = process::Command::new("ffmpeg") .args([