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

Replace slice methods tail(), init() with pop_first(), pop_last() #24184

Closed
wants to merge 2 commits into from

Commits on Apr 8, 2015

  1. Replace slice methods tail(), init() with pop_first(), pop_last()

    The `init`/`tail` terminology is not obvious to anyone who hasn't
    already seen it in another language like Haskell, and we already got rid
    of `head()` (the common pair for `tail()`).
    
    Instead of merely renaming these functions, turn them into separate
    functions
    
        fn pop_first(&self) -> Option<(&T, &[T])>;
        fn pop_last(&self) -> Option<(&T, &[T])>;
    
    as these functions are often used in a context where the first/last
    element wants to be inspected and it's a bit more ergonomic this way.
    lilyball committed Apr 8, 2015
    Configuration menu
    Copy the full SHA
    8c741bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e9dc7fb View commit details
    Browse the repository at this point in the history