Skip to content

Conversation

@frewsxcv
Copy link
Contributor

@frewsxcv frewsxcv commented Aug 10, 2016

AsRef is designed for conversions that are "cheap" (as per
the API docs). It is the case that retrieving the underlying
data of std::slice::Iter is cheap. In my opinion, there's no
ambiguity about what slice data will be returned, otherwise,
I would be more cautious about implementing AsRef.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have to make up a new feature name for this, even if it's stable.

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Aug 10, 2016
@alexcrichton alexcrichton self-assigned this Aug 10, 2016
@alexcrichton
Copy link
Member

Thanks for the PR @frewsxcv! Could you also expand on the motivation for this as well?

`AsRef` is designed for conversions that are "cheap" (as per
the API docs). It is the case that retrieving the underlying
data of `std::slice::Iter` is cheap. In my opinion, there's no
ambiguity about what slice data will be returned, otherwise,
I would be more cautious about implementing `AsRef`.
@frewsxcv
Copy link
Contributor Author

Thanks for the PR @frewsxcv! Could you also expand on the motivation for this as well?

Updated.

@alexcrichton
Copy link
Member

Thanks! This libs team discussed this PR during triage yesterday and the decision was to merge.

@bors: r+

@bors
Copy link
Collaborator

bors commented Aug 16, 2016

📌 Commit dc22186 has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 17, 2016

⌛ Testing commit dc22186 with merge 9376da6...

bors added a commit that referenced this pull request Aug 17, 2016
Implement `AsRef<[T]>` for `std::slice::Iter`.

`AsRef` is designed for conversions that are "cheap" (as per
the API docs). It is the case that retrieving the underlying
data of `std::slice::Iter` is cheap. In my opinion, there's no
ambiguity about what slice data will be returned, otherwise,
I would be more cautious about implementing `AsRef`.
@bors bors merged commit dc22186 into rust-lang:master Aug 17, 2016
@frewsxcv frewsxcv deleted the slice-iter-as-ref branch October 2, 2016 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants