Skip to content

chore(internals): drop no-std supp in internals#519

Open
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-nostd-internals
Open

chore(internals): drop no-std supp in internals#519
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-nostd-internals

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Mar 12, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified feature configuration across crates for standard library and allocation support, reducing conditional feature gates.
    • Hex formatting utilities are now always available (no longer gated by allocation feature), improving consistency across builds.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47a780cc-7f83-4954-aea9-2d7ff09411b4

📥 Commits

Reviewing files that changed from the base of the PR and between 4410fb6 and d0ff4f7.

📒 Files selected for processing (5)
  • dash/Cargo.toml
  • hashes/Cargo.toml
  • internals/Cargo.toml
  • internals/src/hex/display.rs
  • internals/src/lib.rs
💤 Files with no reviewable changes (2)
  • internals/src/lib.rs
  • internals/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • dash/Cargo.toml
  • hashes/Cargo.toml

📝 Walkthrough

Walkthrough

Removed feature-gated alloc/std support in internals and adjusted dependent crates' features; eliminated no_std and internal prelude, made hex display methods and their tests unconditional, and changed implementations to use the standard Vec<u8> type.

Changes

Cohort / File(s) Summary
Cargo Feature Configuration
dash/Cargo.toml, hashes/Cargo.toml, internals/Cargo.toml
Removed internals/std and internals/alloc feature definitions/usages; simplified std/alloc feature wiring so internals no longer exposes feature-gated alloc/std flags.
Internals source & tests
internals/src/hex/display.rs, internals/src/lib.rs
Dropped #[cfg(feature = "alloc")] gates and no_std usage; removed internal prelude re-export; changed impl types from alloc::vec::Vec<u8> to Vec<u8>; flattened and made tests unconditional.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through features, bold and spry,
Gates fell away beneath my sky.
Vecs now dance without a fence,
No prelude fuss, the code's more dense.
A tidy patch — a rabbit's sigh.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: removing no-std support from the internals crate, which is evident from the removal of no_std attribute, feature gates, and conditional compilation throughout internals and dependent crates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/drop-nostd-internals
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting to disable sequence diagrams in the walkthrough.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internals/src/hex/display.rs`:
- Around line 272-324: Add a unit test that exercises the newly added impl
DisplayHex for &Vec<u8> directly (current tests only call the &[u8] path via
check_encoding), e.g., add a test function (similar to existing tests like
single/two) that constructs a Vec<u8> and calls check_encoding on a reference to
it so the &Vec<u8> impl is used; reference the check_encoding helper and the
DisplayHex impl for &Vec<u8> when locating where to add the test in this file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1841341-591e-49c0-b65d-57d7bc2ef026

📥 Commits

Reviewing files that changed from the base of the PR and between 9959201 and 4410fb6.

📒 Files selected for processing (5)
  • dash/Cargo.toml
  • hashes/Cargo.toml
  • internals/Cargo.toml
  • internals/src/hex/display.rs
  • internals/src/lib.rs
💤 Files with no reviewable changes (2)
  • internals/Cargo.toml
  • internals/src/lib.rs

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.90%. Comparing base (b946271) to head (d0ff4f7).

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.42-dev     #519   +/-   ##
==========================================
  Coverage      66.89%   66.90%           
==========================================
  Files            313      313           
  Lines          64753    64754    +1     
==========================================
+ Hits           43317    43324    +7     
+ Misses         21436    21430    -6     
Flag Coverage Δ *Carryforward flag
core 75.02% <100.00%> (ø)
dash-network 74.97% <ø> (-0.04%) ⬇️ Carriedforward from b946271
dash-network-ffi 34.76% <ø> (ø) Carriedforward from b946271
dash-spv 68.26% <ø> (ø) Carriedforward from b946271
dash-spv-ffi 34.76% <ø> (ø) Carriedforward from b946271
dashcore 74.97% <ø> (-0.04%) ⬇️ Carriedforward from b946271
dashcore-private 74.97% <ø> (-0.04%) ⬇️ Carriedforward from b946271
dashcore-rpc 19.92% <ø> (ø) Carriedforward from b946271
dashcore-rpc-json 19.92% <ø> (ø) Carriedforward from b946271
dashcore_hashes 74.97% <ø> (-0.04%) ⬇️ Carriedforward from b946271
ffi 36.70% <ø> (+0.10%) ⬆️
key-wallet 65.64% <ø> (ø) Carriedforward from b946271
key-wallet-ffi 34.76% <ø> (ø) Carriedforward from b946271
key-wallet-manager 65.64% <ø> (ø) Carriedforward from b946271
rpc 19.92% <ø> (ø)
spv 81.08% <ø> (ø)
wallet 65.67% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
internals/src/hex/display.rs 87.50% <100.00%> (+0.10%) ⬆️

... and 14 files with indirect coverage changes

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

@ZocoLini ZocoLini force-pushed the chore/drop-nostd-internals branch from 4410fb6 to d0ff4f7 Compare March 13, 2026 19:39
@ZocoLini ZocoLini requested a review from xdustinface March 13, 2026 19:56
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.

1 participant