about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-07-26 17:11:10 +0200
committerljedrz <ljedrz@gmail.com>2018-07-29 18:53:22 +0200
commit59c8a279daf6912b99ba089ff6dafbfc3469831e (patch)
treeab821f37fca36aa9730bed95c0cad5fbf3e9eaa4 /src/librustc_codegen_llvm/back
parenta5c2d0fffaaf0b764c01bc4066e51ffd475ceae9 (diff)
downloadrust-59c8a279daf6912b99ba089ff6dafbfc3469831e.tar.gz
rust-59c8a279daf6912b99ba089ff6dafbfc3469831e.zip
Replace push loops with collect() and extend() where possible
Diffstat (limited to 'src/librustc_codegen_llvm/back')
-rw-r--r--src/librustc_codegen_llvm/back/rpath.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/back/rpath.rs b/src/librustc_codegen_llvm/back/rpath.rs
index e73073cfad0..2c3a143646c 100644
--- a/src/librustc_codegen_llvm/back/rpath.rs
+++ b/src/librustc_codegen_llvm/back/rpath.rs
@@ -152,9 +152,7 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
                 (Some(a), Some(_)) => {
                     comps.push(Component::ParentDir);
-                    for _ in itb {
-                        comps.push(Component::ParentDir);
-                    }
+                    comps.extend(itb.map(|_| Component::ParentDir));
                     comps.push(a);
                     comps.extend(ita.by_ref());
                     break;