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
Hex Strings #234
Hex Strings #234
Conversation
You may also want to revise copyright strings... |
On second though, I realized feature-gating from_str was not terribly useful, so I've reorganized things so that from_str is always available. |
impl std::string::ToString for $type { | ||
fn to_string(&self) -> std::string::String { | ||
let mut res = std::string::String::with_capacity($size * 2); | ||
res.extend(std::iter::repeat('-').take($size * 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why -
?
Is there a test with under- and oversized hex string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never assert size, but the -
ensure an unwritten char would be obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concerning missized strings, good point! I'll work on that now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hex library handles them nicely it seems
No description provided.