about summary refs log tree commit diff
path: root/src/liballoc/raw_vec
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-01 04:49:31 +0100
committerGitHub <noreply@github.com>2019-12-01 04:49:31 +0100
commit3db3f156f11cd16fe07a0b90c26740737e29be60 (patch)
treef710d1d16b622b45c84364e6cbfc6e4259f1841d /src/liballoc/raw_vec
parentd4f59564e7898adcce6eaf432e710337ba8cca4c (diff)
parent1c4d4539690fe841aefea2f54c243be5f0579970 (diff)
downloadrust-3db3f156f11cd16fe07a0b90c26740737e29be60.tar.gz
rust-3db3f156f11cd16fe07a0b90c26740737e29be60.zip
Rollup merge of #66890 - dtolnay:fmt4, r=Dylan-DPC
Format liballoc with rustfmt

Same strategy as #66691 -- as with my previous formatting PRs, I am avoiding causing merge conflicts in other PRs by only touches those files that are not involved in any currently open PR. Files that appear in new PRs between when this PR is opened and when it makes it to the top of the bors queue will be reverted from this PR.

The list of files involved in open PRs is determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8).

With the list of files from the script in outstanding_files, the relevant commands were:

```
$ find src/liballoc -name '*.rs' \
    | xargs rustfmt --edition=2018 --unstable-features --skip-children
$ rg liballoc outstanding_files | xargs git checkout --
```

To confirm no funny business:

```
$ git checkout $THIS_COMMIT^
$ git show --pretty= --name-only $THIS_COMMIT \
    | xargs rustfmt --edition=2018 --unstable-features --skip-children
$ git diff $THIS_COMMIT  # there should be no difference
```

r? @Dylan-DPC
Diffstat (limited to 'src/liballoc/raw_vec')
-rw-r--r--src/liballoc/raw_vec/tests.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/liballoc/raw_vec/tests.rs b/src/liballoc/raw_vec/tests.rs
index d35b62fc1ef..b214cef3011 100644
--- a/src/liballoc/raw_vec/tests.rs
+++ b/src/liballoc/raw_vec/tests.rs
@@ -16,7 +16,9 @@ fn allocator_param() {
 
     // A dumb allocator that consumes a fixed amount of fuel
     // before allocation attempts start failing.
-    struct BoundedAlloc { fuel: usize }
+    struct BoundedAlloc {
+        fuel: usize,
+    }
     unsafe impl Alloc for BoundedAlloc {
         unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
             let size = layout.size();
@@ -24,7 +26,10 @@ fn allocator_param() {
                 return Err(AllocErr);
             }
             match Global.alloc(layout) {
-                ok @ Ok(_) => { self.fuel -= size; ok }
+                ok @ Ok(_) => {
+                    self.fuel -= size;
+                    ok
+                }
                 err @ Err(_) => err,
             }
         }