Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/alloc/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use Cow::*;
impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want it to look the same as the AsRef impl, you can also remove the 'a lifetime:

Suggested change
impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
impl<B: ?Sized> Borrow<B> for Cow<'_, B>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of how the rendered documentation comes out, I actually prefer the way it looks with the explicit lifetime, since otherwise it still renders as invalid Rust code with the impl<'_> part.

where
B: ToOwned,
<B as ToOwned>::Owned: 'a,
{
fn borrow(&self) -> &B {
&**self
Expand Down