Skip to content

fix: replace human_bytes with human_repr::HumanCount#6691

Merged
hanabi1224 merged 3 commits intomainfrom
hm/no-human-bytes
Mar 5, 2026
Merged

fix: replace human_bytes with human_repr::HumanCount#6691
hanabi1224 merged 3 commits intomainfrom
hm/no-human-bytes

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Mar 4, 2026

Summary of changes

human_bytes::human_bytes does not accept u64 which might cause overflow error

pub fn human_bytes<T: Into<f64>>(bytes: T) -> String

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Chores
    • Replaced the byte-size formatting library with an alternative implementation across the codebase.
    • Removed an unused transitive dependency to slim the dependency footprint.
    • No user-facing behavior or output structure was changed; byte counts are formatted the same way visually.

@hanabi1224 hanabi1224 marked this pull request as ready for review March 4, 2026 17:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5aa0257d-a493-4a43-8e53-1af1d3bb7b9e

📥 Commits

Reviewing files that changed from the base of the PR and between b8ab1bf and ece153b.

📒 Files selected for processing (1)
  • Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • Cargo.toml

Walkthrough

Replaced usage of the human_bytes crate with the human_repr crate's HumanCount trait across the workspace; byte-size formatting calls changed from human_bytes(...) to the .human_count_bytes() trait method. No functional or public API changes.

Changes

Cohort / File(s) Summary
Workspace Manifest
Cargo.toml
Removed human_bytes = "0.4" and adjusted human-repr to human-repr = { version = "1", features = ["iec", "space"] }.
Byte-formatting updates
src/db/gc/snapshot.rs, src/dev/subcommands/state_cmd.rs, src/tool/subcommands/archive_cmd.rs, src/utils/io/progress_log.rs, src/utils/net/download_file.rs
Added use human_repr::HumanCount as _ imports and replaced human_bytes(...) calls with the .human_count_bytes() method on integer values; changes are formatting-only with no control-flow or API modifications.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • LesnyRumcajs
  • sudo-shashank
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: replacing human_bytes with human_repr::HumanCount throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/no-human-bytes

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 requested a review from a team as a code owner March 4, 2026 17:44
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and sudo-shashank and removed request for a team March 4, 2026 17:44
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.52%. Comparing base (4caac9f) to head (ece153b).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/net/download_file.rs 0.00% 3 Missing ⚠️
src/dev/subcommands/state_cmd.rs 0.00% 2 Missing ⚠️
src/db/gc/snapshot.rs 0.00% 1 Missing ⚠️
src/tool/subcommands/archive_cmd.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/utils/io/progress_log.rs 93.12% <100.00%> (ø)
src/db/gc/snapshot.rs 18.85% <0.00%> (ø)
src/tool/subcommands/archive_cmd.rs 29.47% <0.00%> (ø)
src/dev/subcommands/state_cmd.rs 0.00% <0.00%> (ø)
src/utils/net/download_file.rs 81.09% <0.00%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4caac9f...ece153b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hanabi1224 hanabi1224 added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 967f83a Mar 5, 2026
58 of 59 checks passed
@hanabi1224 hanabi1224 deleted the hm/no-human-bytes branch March 5, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants