Skip to content

Commit

Permalink
address review feedback and clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
brayniac committed Oct 19, 2023
1 parent 042be19 commit 19bc8d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/clients/memcache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn task(work_receiver: Receiver<WorkItem>, endpoint: String, config: Confi
let remaining_time = client_config
.request_timeout()
.as_millis()
.saturating_sub(start.elapsed().as_millis().into());
.saturating_sub(start.elapsed().as_millis());
if remaining_time == 0 {
break Err(ResponseError::Timeout);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pubsub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl MessageValidator {
}

// calculate and return the end to end latency
let ts = u64::from_be_bytes([v[16], v[17], v[18], v[19], v[20], v[21], v[22], v[23]]);
let ts = u64::from_be_bytes(v[16..24].try_into().unwrap());
let latency = now_unix.duration_since(UNIX_EPOCH).unwrap().as_nanos() as u64 - ts;

let _ = PUBSUB_LATENCY.increment(latency);
Expand Down

0 comments on commit 19bc8d1

Please sign in to comment.