Skip to content

Commit

Permalink
♻️ Move video stuff into its file
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh committed May 4, 2024
1 parent 0da829a commit f219c77
Show file tree
Hide file tree
Showing 4 changed files with 699 additions and 703 deletions.
20 changes: 2 additions & 18 deletions src/canvas.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
use core::panic;
use std::{
cmp,
collections::HashMap,
io::{empty, Write},
ops::Range,
};
use std::{cmp, collections::HashMap, io::Write as _, ops::Range};

use chrono::DateTime;
use itertools::Itertools;
use itertools::Itertools as _;
use rand::Rng;

use crate::{
Expand Down Expand Up @@ -446,7 +440,6 @@ impl Canvas {

let stdin = spawned.stdin.as_mut().unwrap();
stdin.write_all(rendered.as_bytes()).unwrap();
drop(stdin);

match spawned.wait_with_output() {
Ok(_) => Ok(()),
Expand Down Expand Up @@ -572,12 +565,3 @@ impl Canvas {
.to_string()
}
}

pub fn milliseconds_to_timestamp(ms: usize) -> String {
format!(
"{}",
DateTime::from_timestamp_millis(ms as i64)
.unwrap()
.format("%H:%M:%S%.3f")
)
}
Loading

0 comments on commit f219c77

Please sign in to comment.