fix a few clippy warns and disable expect_fun_call warn
This commit is contained in:
parent
52c2ec7769
commit
2de2317831
1 changed files with 7 additions and 5 deletions
12
src/main.rs
12
src/main.rs
|
@ -1,3 +1,6 @@
|
||||||
|
#![allow(clippy::expect_fun_call)] // I don't see a reason for this warn
|
||||||
|
|
||||||
|
|
||||||
mod frame;
|
mod frame;
|
||||||
|
|
||||||
use crate::frame::Frame;
|
use crate::frame::Frame;
|
||||||
|
@ -97,11 +100,10 @@ async fn send_video(message: Message, ctx: Context) {
|
||||||
tokio::time::sleep(Duration::from_millis(
|
tokio::time::sleep(Duration::from_millis(
|
||||||
5000 - (unix_millis() - sa)
|
5000 - (unix_millis() - sa)
|
||||||
+ (api_time as i64
|
+ (api_time as i64
|
||||||
* i64::from_str_radix(
|
* str::parse::<i64>(
|
||||||
env::var("PROJBOTV3_API_TIME_FACTOR")
|
env::var("PROJBOTV3_API_TIME_FACTOR")
|
||||||
.unwrap_or("3".into())
|
.unwrap_or_else(|_| "3".into())
|
||||||
.as_str(),
|
.as_str()
|
||||||
10,
|
|
||||||
)
|
)
|
||||||
.unwrap()) as u64,
|
.unwrap()) as u64,
|
||||||
))
|
))
|
||||||
|
@ -253,7 +255,7 @@ async fn main() {
|
||||||
// If vid_encoded doesn't exist, convert vid.mp4 into vid_encoded
|
// If vid_encoded doesn't exist, convert vid.mp4 into vid_encoded
|
||||||
if !Path::new("vid_encoded/").is_dir() {
|
if !Path::new("vid_encoded/").is_dir() {
|
||||||
println!("encode: encoding video...");
|
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
|
// We're using ffmpeg commands because ffmpeg's api is a hunk of junk
|
||||||
let mut command = process::Command::new("ffmpeg")
|
let mut command = process::Command::new("ffmpeg")
|
||||||
.args([
|
.args([
|
||||||
|
|
Loading…
Add table
Reference in a new issue