From 69139bdd0e5f9ce782e6e0758bc5440d18aa6a19 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 20 Nov 2023 12:04:06 +0000 Subject: [PATCH] Bump MSRV to 1.51 and use unsigned_abs --- rand_jitter/Cargo.toml | 1 + rand_jitter/README.md | 2 +- rand_jitter/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rand_jitter/Cargo.toml b/rand_jitter/Cargo.toml index 3f5f582d..75f96334 100644 --- a/rand_jitter/Cargo.toml +++ b/rand_jitter/Cargo.toml @@ -9,6 +9,7 @@ documentation = "https://docs.rs/rand_jitter" description = "Random number generator based on timing jitter" keywords = ["random", "rng", "os"] edition = "2018" +rust-version = "1.51" [dependencies] rand_core = { version = "0.6" } diff --git a/rand_jitter/README.md b/rand_jitter/README.md index 149b590a..e84e41f6 100644 --- a/rand_jitter/README.md +++ b/rand_jitter/README.md @@ -5,7 +5,7 @@ [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_jitter) [![API](https://docs.rs/rand_jitter/badge.svg)](https://docs.rs/rand_jitter) -[![Minimum rustc version](https://img.shields.io/badge/rustc-1.36+-lightgray.svg)](https://github.com/rust-random/rngs#rust-version-requirements) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.51-lightgray.svg)](https://github.com/rust-random/rngs#rust-version-requirements) Non-physical true random number generator based on timing jitter. diff --git a/rand_jitter/src/lib.rs b/rand_jitter/src/lib.rs index 3c8815cf..f6e80e4e 100644 --- a/rand_jitter/src/lib.rs +++ b/rand_jitter/src/lib.rs @@ -643,7 +643,7 @@ where // Ensure that we have a varying delta timer which is necessary for // the calculation of entropy -- perform this check only after the // first loop is executed as we need to prime the old_delta value - delta_sum += (delta - old_delta).abs() as u64; + delta_sum += (delta - old_delta).unsigned_abs() as u64; old_delta = delta; }