Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

fixed encoding 0u8 #992

Merged
merged 2 commits into from Apr 24, 2016
Merged

fixed encoding 0u8 #992

merged 2 commits into from Apr 24, 2016

Conversation

debris
Copy link
Collaborator

@debris debris commented Apr 24, 2016

according to the docs 0u8 should be encoded as empty string

@debris debris added the A0-pleasereview 🤓 Pull request needs code review. label Apr 24, 2016
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Apr 24, 2016
}

fn bytes_len(&self) -> usize { 1 }
fn bytes_len(&self) -> usize {
if self.0 == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

just use match self.0 { 0 => 0, _ => 1 }

@gavofyork gavofyork added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Apr 24, 2016
@debris debris added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Apr 24, 2016
This was referenced Apr 24, 2016
@gavofyork gavofyork merged commit 80a28b9 into master Apr 24, 2016
@gavofyork gavofyork deleted the encoding-u8 branch April 24, 2016 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-pleasereview 🤓 Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants