Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove p!.
It's a cryptic macro that makes some things slightly more concise in
`PrettyPrinter`. E.g. if you declare `define_scope_printer!(p)` in a
scope you can then call `p! to get these transformations:
```
p!("foo");         -->  write!(p, "foo")?;
p!(print(ty));     -->  ty.print(p)?;
p!(method(args));  -->  p.method(args)?;
```
You can also chain calls, e.g.:
```
p!("foo", print(ty));  -->  write!(p, "foo")?; ty.print(p)?;
```
Ultimately this doesn't seem worth it. The macro definition is hard to
read, the call sites are hard to read, `define_scope_printer!` is pretty
gross, and the code size reductions are small. Tellingly, many normal
`write!` and `print` calls are sprinkled throughout the code, probably
because people have made modifications and didn't want to use or
understand how to use `p!`.

This commit removes it.
  • Loading branch information
nnethercote committed Aug 3, 2025
commit 03dab500a2a885c3cf196d6d72695deda7da7698
Loading