-
Notifications
You must be signed in to change notification settings - Fork 59
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
Split encoding::types into encoding-types crate #89
Conversation
It looks mostly fine to me, with the following caveats:
|
for ch in string.chars() { | ||
match ch { | ||
'a'...'z' => { output.write_char(rotate_byte(ch as u8) as char) }, | ||
'A'...'Z' => { output.write_char(rotate_byte(ch as u8) as char) }, |
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.
Is this split intentional?
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.
Yes, ROT13 is defined to only work on basic latin characters (a to z and A to Z). In ASCII table uppercase and lowercase letters are not adjacent, therefore the split.
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.
I meant that 'a'...'z' | 'A'...'Z'
would probably work.
The tests depend on |
This allows for creation of alternative non-WHATWG encodings that use the same interface as encodings defined in this crate without pulling in all the tables and encodings. This commit does not introduce any breaking changes; all the types previously defined in encoding::types are reexported. Fixes lifthrasiir#81.
Split encoding::types into encoding-types crate
@nagisa Ah, that's a legitimate reason (and my suggestion can be incrementally implemented anyway). I have no reason not to merge this, so I went ahead; thank you for the PR! |
This allows for creation of alternative non-WHATWG encodings that use the same
interface as encodings defined in this crate without pulling in all the
tables and encodings.
This commit does not introduce any breaking changes; all the types previously defined in
encoding::types are reexported.
Fixes #81.
I tried to avoid breaking changes for now, but IMO
fn decode
being inencoding::types
makes little sense; I’d move it toencoding
at some point later.