Skip to content

Commit

Permalink
build(deps): update humansize requirement from 1 to 2
Browse files Browse the repository at this point in the history
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] <[email protected]>
  • Loading branch information
dependabot[bot] authored and camshaft committed Mar 29, 2023
1 parent 5febc3e commit 83c18b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
3 changes: 2 additions & 1 deletion quic/s2n-quic-qns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
19 changes: 4 additions & 15 deletions quic/s2n-quic-qns/src/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))
}

0 comments on commit 83c18b5

Please sign in to comment.