diff options
| author | Joshua Landau <joshua@landau.ws> | 2015-06-11 13:56:07 +0100 |
|---|---|---|
| committer | Joshua Landau <joshua@landau.ws> | 2015-06-11 13:56:07 +0100 |
| commit | d7f5fa4636b12c3dadd626e708ec7cef654faf54 (patch) | |
| tree | 26d1cae1de4f3b8d179cf008e380b6396bd9070f /src/libsyntax | |
| parent | ca7418b84658fc1c723672c462aa0a7878d88b64 (diff) | |
| download | rust-d7f5fa4636b12c3dadd626e708ec7cef654faf54.tar.gz rust-d7f5fa4636b12c3dadd626e708ec7cef654faf54.zip | |
Conver reborrows to .iter() calls where appropriate
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 8 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 423996ce6d0..7d7ea371ba5 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -330,7 +330,7 @@ pub struct IdVisitor<'a, O:'a> { impl<'a, O: IdVisitingOperation> IdVisitor<'a, O> { fn visit_generics_helper(&mut self, generics: &Generics) { - for type_parameter in &*generics.ty_params { + for type_parameter in generics.ty_params.iter() { self.operation.visit_id(type_parameter.id) } for lifetime in &generics.lifetimes { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index b2a366ec5be..98225d10400 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -796,7 +796,7 @@ impl CodeMap { } pub fn get_filemap(&self, filename: &str) -> Rc<FileMap> { - for fm in &*self.files.borrow() { + for fm in self.files.borrow().iter() { if filename == fm.name { return fm.clone(); } @@ -821,7 +821,7 @@ impl CodeMap { // The number of extra bytes due to multibyte chars in the FileMap let mut total_extra_bytes = 0; - for mbc in &*map.multibyte_chars.borrow() { + for mbc in map.multibyte_chars.borrow().iter() { debug!("{}-byte char at {:?}", mbc.bytes, mbc.pos); if mbc.pos < bpos { // every character is at least one byte, so we only diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 3c432739111..ec3006898f3 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -505,7 +505,7 @@ impl<'a> TraitDef<'a> { bounds.push(cx.typarambound(trait_path.clone())); // also add in any bounds from the declaration - for declared_bound in &*ty_param.bounds { + for declared_bound in ty_param.bounds.iter() { bounds.push((*declared_bound).clone()); } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 8958370fda5..3adb73cfa5d 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2110,7 +2110,7 @@ impl<'a> State<'a> { comma = true; } - for binding in &*data.bindings { + for binding in data.bindings.iter() { if comma { try!(self.word_space(",")) } @@ -2845,7 +2845,7 @@ impl<'a> State<'a> { } ast::LitBinary(ref v) => { let mut escaped: String = String::new(); - for &ch in &**v { + for &ch in v.iter() { escaped.extend(ascii::escape_default(ch) .map(|c| c as char)); } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 61fddd6bed8..710928a00c1 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -428,13 +428,13 @@ pub fn walk_path_parameters<'v, V: Visitor<'v>>(visitor: &mut V, path_parameters: &'v PathParameters) { match *path_parameters { ast::AngleBracketedParameters(ref data) => { - for typ in &*data.types { + for typ in data.types.iter() { visitor.visit_ty(&**typ); } for lifetime in &data.lifetimes { visitor.visit_lifetime_ref(lifetime); } - for binding in &*data.bindings { + for binding in data.bindings.iter() { visitor.visit_assoc_type_binding(&**binding); } } @@ -531,7 +531,7 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(visitor: &mut V, pub fn walk_ty_param_bounds_helper<'v, V: Visitor<'v>>(visitor: &mut V, bounds: &'v OwnedSlice<TyParamBound>) { - for bound in &**bounds { + for bound in bounds.iter() { visitor.visit_ty_param_bound(bound) } } @@ -549,7 +549,7 @@ pub fn walk_ty_param_bound<'v, V: Visitor<'v>>(visitor: &mut V, } pub fn walk_generics<'v, V: Visitor<'v>>(visitor: &mut V, generics: &'v Generics) { - for param in &*generics.ty_params { + for param in generics.ty_params.iter() { visitor.visit_ident(param.span, param.ident); walk_ty_param_bounds_helper(visitor, ¶m.bounds); walk_ty_opt(visitor, ¶m.default); |
