mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Remove redundant delay calc
This commit is contained in:
@@ -102,11 +102,9 @@ pub async fn play(
|
|||||||
let delay = time.as_micros() as i64 - epoch.elapsed().as_micros() as i64;
|
let delay = time.as_micros() as i64 - epoch.elapsed().as_micros() as i64;
|
||||||
|
|
||||||
if delay > 0 {
|
if delay > 0 {
|
||||||
let delay = (time.as_micros() as i64 - epoch.elapsed().as_micros() as i64)
|
|
||||||
.max(0) as u64;
|
|
||||||
|
|
||||||
if let Ok(result) =
|
if let Ok(result) =
|
||||||
time::timeout(Duration::from_micros(delay), tty.read(&mut input)).await
|
time::timeout(Duration::from_micros(delay as u64), tty.read(&mut input))
|
||||||
|
.await
|
||||||
{
|
{
|
||||||
let n = result?;
|
let n = result?;
|
||||||
let key = &input[..n];
|
let key = &input[..n];
|
||||||
|
|||||||
Reference in New Issue
Block a user