Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pretty-printing into the crate, gated by a feature #137

Merged
merged 2 commits into from Feb 27, 2023

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Feb 21, 2023

We are using rust-cpuid in Humility to decode CPU features, and it has been great!

The pretty-printing code currently in src/bin/cpuid.rs would be very helpful as library code, since we'd like pretty-printing but don't want to call an external binary.

This PR moves that pretty-printing code into a new module (display) in the crate itself. This module is gated by the display feature; by default, it's off and the crate is still no_std. If you enable that feature, then you have access to the raw_cpuid::display module, which exposes those nice pretty-printing functions.

(there's also a bit of feature wrangling to make the cli feature enable display, etc, but nothing too weird)

@codecov-commenter
Copy link

Codecov Report

Merging #137 (e71585c) into master (e86d96b) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
- Coverage   39.36%   39.34%   -0.02%     
==========================================
  Files           3        4       +1     
  Lines        4070     4072       +2     
==========================================
  Hits         1602     1602              
- Misses       2468     2470       +2     
Impacted Files Coverage Δ
src/bin/cpuid.rs 4.34% <0.00%> (+4.27%) ⬆️
src/display.rs 0.00% <0.00%> (ø)
src/lib.rs 51.26% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gz
Copy link
Owner

gz commented Feb 27, 2023

hi this lgtm, thanks for the improvement!

@gz gz merged commit a6d8786 into gz:master Feb 27, 2023
@gz
Copy link
Owner

gz commented Feb 27, 2023

Released as 10.7.0

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.

None yet

3 participants