lifthrasiir / rust-encoding

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

Implement fmt::Debug for Encoding #97

Closed justinas closed 8 years ago

justinas commented 8 years ago

(note: scratching my own itch)

Implemented fmt::Debug trait for Encoding, as it not being implemented prevented from deriving Debug for any type that contains Encoding or EncodingRef.

lifthrasiir commented 8 years ago

Hmm, I didn't try to implement Debug since it has too many choices for "appropriate" implementations with less benefits, but I guess it is fine to have some implementation. It looks good to me [1], thank you for the PR!

[1] I once pondered about a guideline on Debug implementations: Python's repr does have something like that (it should print either a close-to-valid Python expr or a clearly invalid <>-enclosed description), but Rust does not seem to have that. For now I will leave it as is, but it may change in the future if the concensus arises.

justinas commented 8 years ago

[1]

Sure thing. I do not care that much about specific formatting of the output, as long as Debug is implemented.