Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

style: use saturating_sub and drop a narrating comment

Richie McIlroy1dca6d6a290b
diff --git a/crates/recording/examples/cursor-poll-benchmark.rs b/crates/recording/examples/cursor-poll-benchmark.rs
index 9de58bbb6..b7a6acd70 100644
--- a/crates/recording/examples/cursor-poll-benchmark.rs
+++ b/crates/recording/examples/cursor-poll-benchmark.rs
@@ -71,7 +71,7 @@ fn main() -> anyhow::Result<()> {
let wall = started.elapsed();
let cpu = process_cpu()
.zip(started_cpu)
- .map(|(now, started)| (now - started).as_secs_f64());
+ .map(|(now, started)| now.saturating_sub(started).as_secs_f64());
let response = futures::executor::block_on(actor.rx.clone())
.map_err(|_| anyhow::anyhow!("The cursor recorder exited without a response"))?;
diff --git a/crates/recording/src/cursor.rs b/crates/recording/src/cursor.rs
index 48edf215a..45a8ee072 100644
--- a/crates/recording/src/cursor.rs
+++ b/crates/recording/src/cursor.rs
@@ -535,8 +535,6 @@ fn keycode_to_string(key: &device_query::Keycode) -> (String, String) {
(display.to_string(), code.to_string())
}
-/// Appends a down event for each key held now but not before, then an up event
-/// for each key released since, in that order.
fn push_key_changes(
previous: &[device_query::Keycode],
current: &[device_query::Keycode],