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

Rename vec::to_mut/from_mut #3355

Closed
brson opened this issue Sep 2, 2012 · 4 comments
Closed

Rename vec::to_mut/from_mut #3355

brson opened this issue Sep 2, 2012 · 4 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Sep 2, 2012

These are casting functions, not conversion functions. Maybe cast_to_mut, cast_from_mut, or transmut_to_mut, transmute_from_mut (seems to be an established pattern, per core::unsafe).

@nikomatsakis
Copy link
Contributor

There is also a good argument for removing the mutable variants of vectors altogether. There is little need for it, particularly as mutability is inherited through uniqueness. In other words, one can write:

let mut x = ~[1, 2, 3];
x[0] += 1;

and still the type of x is ~[mut int].

@pcwalton
Copy link
Contributor

pcwalton commented Sep 3, 2012

+1 on removing mutable vectors. A smaller language is a happier language.

@graydon
Copy link
Contributor

graydon commented Sep 3, 2012

Sorta. There's still the question of shared vecs...

@thestinger
Copy link
Contributor

These were removed by 573a31d

RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 9, 2024
Use cargo miri clean in build-all-targets.sh
jaisnan pushed a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
Resolves rust-lang#3353

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants