Skip to content

Implement BorrowFrom<&'static [T]> for [T] #19131

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

Closed
wants to merge 1 commit into from

Conversation

sfackler
Copy link
Member

No description provided.

impl<T> BorrowFrom<&'static [T]> for [T] {
fn borrow_from<'a>(owned: &'a &'static [T]) -> &'a [T] { &**owned }
}

Copy link
Member

Choose a reason for hiding this comment

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

Couldn't the two impls be replaced with impl<Sized? T> BorrowFrom<&'static T> for T?

Copy link
Contributor

Choose a reason for hiding this comment

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

On that note, shouldn't it just be impl<Sized? T, 'a> BorrowFrom<&'a T> for T?

@gereeter
Copy link
Contributor

Now that #19146 has been accepted, should this be removed from the queue and closed?

@sfackler sfackler closed this Nov 21, 2014
@sfackler sfackler deleted the borrow-from-slice branch November 21, 2014 03:35
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 22, 2014
bors added a commit that referenced this pull request Nov 23, 2014
This should be a more general version of #19131.
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

Successfully merging this pull request may close these issues.

4 participants