Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
b3827e4f3728b77bd3e60587487ebfc3cc8d901b
rust/tests/ui/array-slice-vec/vec-mut-iter-borrow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
129 B
Rust
Raw Normal View History

std: add an external iterator for mutating vec elements
2013-06-06 15:12:39 +10:00
fn main() {
Changed most vec! invocations to use square braces Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29 22:54:04 +01:00
let mut xs: Vec<isize> = vec![];
std: add an external iterator for mutating vec elements
2013-06-06 15:12:39 +10:00
`for x in xs.iter_mut()` -> `for x in &mut xs` Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-01-31 20:02:00 -05:00
for x in &mut xs {
Kill more `isize`s
2015-01-31 17:23:42 +01:00
xs.push(1) //~ ERROR cannot borrow `xs`
std: add an external iterator for mutating vec elements
2013-06-06 15:12:39 +10:00
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3924ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API