diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-10-11 17:51:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-11 17:51:26 +0200 |
| commit | 0b7fe4d67cc4d3b09bea212a9a94d41b36d5d50c (patch) | |
| tree | 21598ece634c0a905bed73f441b825d0c896c3c6 /src/rustllvm/RustWrapper.cpp | |
| parent | 6717dba27629735c4305de018070db0e188f6b17 (diff) | |
| parent | 2b7222d3ececbdc9840a3d7bd34f6cca905b80ad (diff) | |
| download | rust-0b7fe4d67cc4d3b09bea212a9a94d41b36d5d50c.tar.gz rust-0b7fe4d67cc4d3b09bea212a9a94d41b36d5d50c.zip | |
Rollup merge of #36699 - bluss:repeat-str, r=alexcrichton
Add method str::repeat(self, usize) -> String It is relatively simple to repeat a string n times: `(0..n).map(|_| s).collect::<String>()`. It becomes slightly more complicated to do it “right” (sizing the allocation up front), which warrants a method that does it for us. This method is useful in writing testcases, or when generating text. `format!()` can be used to repeat single characters, but not repeating strings like this.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
