Skip to content

audit uses of as_ref() and remove those that are ambiguous #1466

Closed
@BurntSushi

Description

@BurntSushi

Adding a trait impl in bstr 1.9.2 (which is yanked for now) caused gix-credentials to fail to compile.

The issue looks to be the result of using ambiguous as_ref(). That is, an as_ref() whose inference relies on the fact that there is only one trait implementation to choose from. If new trait implementations are added, then inference fails and a compile error occurs.

I think this has happened before with gix, although I don't remember the precise details. What do you think about doing an audit for as_ref() usage? In general, I'd like to be able to add trait implementations to bstr as they come up, but I also don't want to be breaking folks downstream of me. :-)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions