rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6.06k stars 892 forks source link

Refactor `Shape` #2825

Open nrc opened 6 years ago

nrc commented 6 years ago

Shape is one of the key abstractions in Rustfmt, representing the space into which an AST node can be written. Unfortunately it is a mess - the structure is weird, the fields are badly named, and the methods are unintuitive. Documentation is also non-existent. We can do better!

nrc commented 6 years ago

Some thoughts on how to do it: