Skip to content
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

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

Open
minty99 opened this issue Feb 20, 2024 · 0 comments

Comments

@minty99
Copy link

minty99 commented Feb 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant