]> git.lizzy.rs Git - rust.git/commit
auto merge of #16885 : wickerwaka/rust/fmt-center, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 4 Sep 2014 14:50:59 +0000 (14:50 +0000)
committerbors <bors@rust-lang.org>
Thu, 4 Sep 2014 14:50:59 +0000 (14:50 +0000)
commit4a5a9c56319fbbf47094fb97d1171a0ed8e89239
treed0b072659eb2326d7efed2308c46fca4456af17c
parent8d5e64f3bc2f754bed4b5a1857dd3494c5049c50
parent2bc4a5e92aef51bd34a5b1a506c5edcee893d6ac
auto merge of #16885 : wickerwaka/rust/fmt-center, r=alexcrichton

Use '^' to specify center alignment in format strings.

```
fmt!( "[{:^5s}]", "Hi" ) -> "[ Hi  ]"
fmt!( "[{:^5s}]", "H" )  -> "[  H  ]"
fmt!( "[{:^5d}]", 1i )   -> "[  1  ]"
fmt!( "[{:^5d}]", -1i )  -> "[ -1  ]"
fmt!( "[{:^6d}]", 1i )   -> "[  1   ]"
fmt!( "[{:^6d}]", -1i )  -> "[  -1  ]"
```

If the padding is odd then the padding on the right will be one
character longer than the padding on the left.