diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-09-24 19:35:24 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-10-11 00:24:23 +0200 |
| commit | 2b7222d3ececbdc9840a3d7bd34f6cca905b80ad (patch) | |
| tree | ee5718d6f3fd2b88569d602a733d8d7d96001a74 /src/test/run-pass/thinlto | |
| parent | a5dbf8a0f8843c5466c3866cc2a288c0ef7051d2 (diff) | |
| download | rust-2b7222d3ececbdc9840a3d7bd34f6cca905b80ad.tar.gz rust-2b7222d3ececbdc9840a3d7bd34f6cca905b80ad.zip | |
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/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
