Skip to content

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

Description

@minty99

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions