Skip to content
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

Add checkup in tail function and return Option type #24172

Closed
wants to merge 1 commit into from

Conversation

GuillaumeGomez
Copy link
Member

Fixes #24141.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@lilyball
Copy link
Contributor

lilyball commented Apr 8, 2015

This makes tail() inconsistent with tail_mut(), init(), and init_mut().

@lilyball
Copy link
Contributor

lilyball commented Apr 8, 2015

I'm working on a separate PR that implements my proposal, of replacing tail() / init() with pop_first() / pop_last().

@lilyball
Copy link
Contributor

lilyball commented Apr 8, 2015

My PR has been submitted as #24184.

@nikomatsakis
Copy link
Contributor

Hmm. @kballard's PR is a bit more ambitious, so they're not directly comparable; but at minimum I agree that having tail be inconsistent with the other fns doesn't seem quite right!

@nikomatsakis
Copy link
Contributor

So I'm going to leave this PR open as an alternative to #24184. I figure we might decide to take this PR, #24184, or neither. But let's move the conversation to #24141 so it can be consolidated.

@bors
Copy link
Contributor

bors commented Apr 22, 2015

☔ The latest upstream changes (presumably #24674) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

I think I'm going to close this due to rust-lang/rfcs#1058 -- let's see how that pans out, but that approach in some form seems to be popular.

@nikomatsakis
Copy link
Contributor

Thanks @GuillaumeGomez for the PR in any case!

@GuillaumeGomez GuillaumeGomez deleted the tail_change branch April 27, 2015 14:05
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.

Calling .tail() on a empty slice panics
5 participants