diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-03-27 12:37:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-27 12:37:20 +0900 |
| commit | c1432679017cadb3b0dd3c6c7653e8ba138e4c63 (patch) | |
| tree | 82e94b9c772b3191fc4496bed37d250549ee8adf /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | d7216bae233d8e5f1191ec0c7dcf741789a235b0 (diff) | |
| parent | 93737dc634f42d07441db2acf26a88ae2e888d9f (diff) | |
| download | rust-c1432679017cadb3b0dd3c6c7653e8ba138e4c63.tar.gz rust-c1432679017cadb3b0dd3c6c7653e8ba138e4c63.zip | |
Rollup merge of #83388 - alamb:alamb/fmt-dcs, r=Mark-Simulacrum
Make # pretty print format easier to discover
# Rationale:
I use (cargo cult?) three formats in rust: `{}`, debug `{:?}`, and pretty-print debug `{:#?}`. I discovered `{:#?}` in some blog post or guide when I started working in Rust. While `#` is documented I think it is hard to discover. So taking the good advice of ```@carols10cents``` I am trying to improve the docs with a PR
As a reminder "pretty print" means that where `{:?}` will print something like
```
foo: { b1: 1, b2: 2}
```
`{:#?}` will prints something like
```
foo {
b1: 1
b2: 3
}
```
# Changes
Add an example to `fmt` to try and make it easier to discover `#`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
