lifthrasiir / rust-encoding

Character encoding support for Rust
MIT License
284 stars 59 forks source link

Split encoding::types into encoding-types crate #89

Closed nagisa closed 9 years ago

nagisa commented 9 years ago

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 in encoding::types makes little sense; I’d move it to encoding at some point later.

lifthrasiir commented 9 years ago

It looks mostly fine to me, with the following caveats:

nagisa commented 9 years ago

I guess most (and in fact all, but I haven't tried that) types tests should be actually in a new crate.

The tests depend on encoding::util which is a private module, therefore moving tests without rewriting them to not use index_iter is not possible. Do you still want to move them? I’ll change tests to not use index_iter then.

lifthrasiir commented 9 years ago

@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!