Skip to content

Tracking issue for Replace Vec::drain by a method that accepts a range parameter (RFC 574) #23055

Closed

Description

Activity

  1. added
    B-RFC-approved
    on Mar 5, 2015
  2. added a commit that references this issue on May 2, 2015
  3. paulp commented on Jun 14, 2015

    @paulp

    The rfc says

    Where Trait is some trait that is implemented for at least Range, RangeTo, RangeFrom, FullRange, and usize.

    It also includes an example which depends on usize:

    fn remove(x: &mut Vec<u8>, index: usize) -> u8 {
        x.drain_range(index).next().unwrap()
    }

    However RangeArgument only implements the first four. Furthermore as things stand it does not appear possible to accept RangeArgument and usize simultaneously, because dispatch doesn't consider the trait bound and reports that conflicting implementations exist.

  4. bluss commented on Jul 13, 2015

    @bluss
    Contributor

    @paulp Yes, #24781 was explicit about these issues. I forsee a new RFC to finish off drain and maybe the RangeArgument trait.

  5. added
    T-libs-api
    on Aug 11, 2015
  6. alexcrichton commented on Feb 18, 2016

    @alexcrichton
    Member

    I believe this has since been implemented

  7. added a commit that references this issue on Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedT-libs-api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions