bazel /
crubit /
92ca26198eaead02e1b474bf5561b8ec62dff69a Implement `ToTokens` on `RsTypeKind`, making it usable in-place as something that can be formatted.
This renders `RsTypeKind` into a full replacement for `TokenStream`: anywhere you're throwing around serialized tokens, you can instead pass around an `RsTypeKind` as structured data, preserving understanding of the underlying source / AST. It also makes formatting slightly less code.
This does somewhat move against the direction suggested in the code, where it suggests we may want to in the future return `RsSnippet`. But one could just as easily imagine deciding the format up-front at `RsTypeKind`-creation-time, and in fact that's already what we do for deciding the namespacing for Record. At any rate, YAGNI! better to simplify the interface now, and complexify it only later if necessary.
PiperOrigin-RevId: 439894243
1 file changed