Skip to content

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 12, 2017

implements #30877
supersedes #32681

r? @alexcrichton

@brson
Copy link
Contributor

brson commented Jan 14, 2017

In @sfackler's last comment. The Bound variants were called Inclusive and Exclusive whereas in this patch they are Included and Excluded. Is it appropriate to change them in this patch?

Bound::Included(&end) => end + 1,
Bound::Excluded(&end) => end,
Bound::Unbounded => self.len(),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the contract wrt to wrapping of the bounds arithmetic here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No issue, containers can't be bigger than isize::max afaik

Bound::Included(&end) => end + 1,
Bound::Excluded(&end) => end,
Bound::Unbounded => len,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto re wrapping.

@alexcrichton
Copy link
Member

Oops sorry I think this accidentally fell out of my inbox, but thanks for the PR @oli-obk! I think that this is covered currently by #38610 though, right?

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jan 14, 2017
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 14, 2017

Indeed, it is covered by that, although the bound methods are named differently.

@oli-obk oli-obk closed this Jan 14, 2017
@oli-obk oli-obk deleted the range_argument branch January 14, 2017 07:07
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