From 83c18b5ac2510ee81477315621b574e3dab5ffae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 00:51:12 +0000 Subject: [PATCH] build(deps): update humansize requirement from 1 to 2 Updates the requirements on [humansize](https://github.com/LeopoldArkham/humansize) to permit the latest version. - [Release notes](https://github.com/LeopoldArkham/humansize/releases) - [Commits](https://github.com/LeopoldArkham/humansize/commits) --- updated-dependencies: - dependency-name: humansize dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- quic/s2n-quic-qns/Cargo.toml | 3 ++- quic/s2n-quic-qns/src/perf.rs | 19 ++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/quic/s2n-quic-qns/Cargo.toml b/quic/s2n-quic-qns/Cargo.toml index 768e9e00f4..1532dd76c4 100644 --- a/quic/s2n-quic-qns/Cargo.toml +++ b/quic/s2n-quic-qns/Cargo.toml @@ -16,7 +16,8 @@ bytes = { version = "1", default-features = false } cfg-if = "1" futures = "0.3" http = "0.2" -humansize = "1" +humansize = "2" +mimalloc = { version = "0.1", default-features = false } openssl-sys = { version = "0.9", features = ["vendored"] } s2n-quic-core = { path = "../s2n-quic-core", features = ["testing"] } s2n-quic-h3 = { path = "../s2n-quic-h3" } diff --git a/quic/s2n-quic-qns/src/perf.rs b/quic/s2n-quic-qns/src/perf.rs index 192afb375d..f3ae1e81d5 100644 --- a/quic/s2n-quic-qns/src/perf.rs +++ b/quic/s2n-quic-qns/src/perf.rs @@ -285,15 +285,10 @@ impl Counters { } fn rate(bytes: u64, duration: Duration) -> String { - use humansize::{file_size_opts as opts, FileSize}; - - let opts = opts::FileSizeOpts { - space: false, - ..humansize::file_size_opts::DECIMAL - }; + use humansize::{format_size, DECIMAL}; let bits = bytes * 8; - let value = bits.file_size(opts).unwrap(); + let value = format_size(bits, DECIMAL.space_after_value(false)); let value = value.trim_end_matches('B'); if duration == Duration::from_secs(1) { @@ -304,12 +299,6 @@ fn rate(bytes: u64, duration: Duration) -> String { } fn bytes(value: u64) -> String { - use humansize::{file_size_opts as opts, FileSize}; - - let opts = opts::FileSizeOpts { - space: false, - ..humansize::file_size_opts::DECIMAL - }; - - value.file_size(opts).unwrap() + use humansize::{format_size, DECIMAL}; + format_size(value, DECIMAL.space_after_value(false)) }