prettytable-rs icon indicating copy to clipboard operation
prettytable-rs copied to clipboard

Unexpected `FromIterator<Utf8Char> for Vec<u8>` import by just importing prettytable-rs

Open minty99 opened this issue 1 year ago • 0 comments

In this line of the prettytable-rs library, the format module is made public, exposing the use encode_unicode::Utf8Char within it.

As a result, the encode_unicode crate's impl FromIterator<Utf8Char> for Vec<u8> trait implementation becomes accessible. This accessibility leads to conflicts in code patterns like some_collection.iter().map(|x| x.into()).collect(), where x implements Into<u8>, due to the discovery of multiple FromIterator<T> for Vec<u8> implementations.

It seems unintended for the importing of prettytable-rs to inadvertently import the FromIterator implementation as well. Is there a particular reason for the format module being public? Would it be feasible to limit its scope to pub(crate) or take any other ways? I believe the crate should avoid exporting trait implementations unexpectedly.

minty99 avatar Feb 20 '24 09:02 minty99