diff options
| author | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
| commit | 0e784e16840e8a0c623cc6166de26da9334db3d6 (patch) | |
| tree | cb9ee37525225e3cbe4cda7d7954f2f72d24acb8 /src/libsyntax/ext/format.rs | |
| parent | ceb9bbfbf5933f9df238fecdd14e75304439c4f4 (diff) | |
| parent | fc525eeb4ec3443d29bce677f589b19f31c189bb (diff) | |
| download | rust-0e784e16840e8a0c623cc6166de26da9334db3d6.tar.gz rust-0e784e16840e8a0c623cc6166de26da9334db3d6.zip | |
auto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. Additional details and motivation in the RFC. Note that the iterator *type* names are not changed by this RFC; those are awaiting a separate RFC for standardization. Closes #13660 Closes #16810 [breaking-change]
Diffstat (limited to 'src/libsyntax/ext/format.rs')
| -rw-r--r-- | src/libsyntax/ext/format.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 271a5137bbf..26586684309 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -500,7 +500,7 @@ impl<'a, 'b> Context<'a, 'b> { let mut heads = Vec::new(); // First, declare all of our methods that are statics - for method in self.method_statics.move_iter() { + for method in self.method_statics.into_iter() { let decl = respan(self.fmtsp, ast::DeclItem(method)); lets.push(P(respan(self.fmtsp, ast::StmtDecl(P(decl), ast::DUMMY_NODE_ID)))); @@ -543,7 +543,7 @@ impl<'a, 'b> Context<'a, 'b> { // format! string are shoved into locals. Furthermore, we shove the address // of each variable because we don't want to move out of the arguments // passed to this function. - for (i, e) in self.args.move_iter().enumerate() { + for (i, e) in self.args.into_iter().enumerate() { let arg_ty = match self.arg_types.get(i).as_ref() { Some(ty) => ty, None => continue // error already generated @@ -577,8 +577,8 @@ impl<'a, 'b> Context<'a, 'b> { // Now create a vector containing all the arguments let slicename = self.ecx.ident_of("__args_vec"); { - let args = names.move_iter().map(|a| a.unwrap()); - let mut args = locals.move_iter().chain(args); + let args = names.into_iter().map(|a| a.unwrap()); + let mut args = locals.into_iter().chain(args); let args = self.ecx.expr_vec_slice(self.fmtsp, args.collect()); lets.push(self.ecx.stmt_let(self.fmtsp, false, slicename, args)); } |
