diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-31 20:03:04 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-02-02 13:40:18 -0500 |
| commit | fd702702ee90ddb47d207f8886818c7f91600713 (patch) | |
| tree | 7bed4a4d739e1372d9e101b350297e7946f17819 /src/libsyntax | |
| parent | d5f61b4332f3edd83c43f3f0d52d0381d7a6c37a (diff) | |
| download | rust-fd702702ee90ddb47d207f8886818c7f91600713.tar.gz rust-fd702702ee90ddb47d207f8886818c7f91600713.zip | |
`for x in xs.into_iter()` -> `for x in xs`
Also `for x in option.into_iter()` -> `if let Some(x) = option`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/concat.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 61ddd240abc..e5cd6f63690 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -490,7 +490,7 @@ fn find_stability_generic<'a, pub fn find_stability(diagnostic: &SpanHandler, attrs: &[Attribute], item_sp: Span) -> Option<Stability> { let (s, used) = find_stability_generic(diagnostic, attrs.iter(), item_sp); - for used in used.into_iter() { mark_used(used) } + for used in used { mark_used(used) } return s; } diff --git a/src/libsyntax/ext/concat.rs b/src/libsyntax/ext/concat.rs index 39895a3946a..4e10cc9aacc 100644 --- a/src/libsyntax/ext/concat.rs +++ b/src/libsyntax/ext/concat.rs @@ -25,7 +25,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt, None => return base::DummyResult::expr(sp) }; let mut accumulator = String::new(); - for e in es.into_iter() { + for e in es { match e.node { ast::ExprLit(ref lit) => { match lit.node { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 8b4816f5d2b..2787339aac0 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1420,11 +1420,11 @@ pub fn expand_crate(parse_sess: &parse::ParseSess, let mut cx = ExtCtxt::new(parse_sess, c.config.clone(), cfg); let mut expander = MacroExpander::new(&mut cx); - for def in imported_macros.into_iter() { + for def in imported_macros { expander.cx.insert_macro(def); } - for (name, extension) in user_exts.into_iter() { + for (name, extension) in user_exts { expander.cx.syntax_env.insert(name, extension); } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b7960d9e709..27fd803d3fe 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5445,7 +5445,7 @@ impl<'a> Parser<'a> { seq_sep_trailing_allowed(token::Comma), |p| p.parse_ty_sum() ); - for ty in arg_tys.into_iter() { + for ty in arg_tys { args.push(ast::VariantArg { ty: ty, id: ast::DUMMY_NODE_ID, diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 21cd02b3851..5c42485f239 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -966,7 +966,7 @@ impl<'a> State<'a> { try!(self.print_generics(generics)); let bounds: Vec<_> = bounds.iter().map(|b| b.clone()).collect(); let mut real_bounds = Vec::with_capacity(bounds.len()); - for b in bounds.into_iter() { + for b in bounds { if let TraitTyParamBound(ref ptr, ast::TraitBoundModifier::Maybe) = b { try!(space(&mut self.s)); try!(self.word_space("for ?")); |
