Skip to content

RFC: rename push/pop/unshift/shift to push_{front,back}/pop_{front,back} #10852

Closed
@erickt

Description

@erickt

I'm in the finishing touches of adding a container::MutableSeq, and I'm realizing it's a bit inconsistent that vec has methods like push() whereas DList has push_back(). I personally feel that we should rename the vec methods to make it explicit where exactly we are pushing/popping the values. I suggest that we make these following renames:

.push() => .push_back()
.pop() => .pop_back()
.unshift() => .push_front()
.shift() => .pop_front()

We could also use append() and prepend() for push() and pop(), but I don't like that as much. Or we could rename the DList methods, but I'm also not in favor of that. What does everyone else think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions