ruff/crates/ruff_python_formatter/src
Carl Meyer c80b9a4a90
Reduce size of Stmt from 144 to 120 bytes (#11051)
## Summary

I happened to notice that we box `TypeParams` on `StmtClassDef` but not
on `StmtFunctionDef` and wondered why, since `StmtFunctionDef` is bigger
and sets the size of `Stmt`.

@charliermarsh found that at the time we started boxing type params on
classes, classes were the largest statement type (see #6275), but that's
no longer true.

So boxing type-params also on functions reduces the overall size of
`Stmt`.

## Test Plan

The `<=` size tests are a bit irritating (since their failure doesn't
tell you the actual size), but I manually confirmed that the size is
actually 120 now.
2024-04-19 17:02:17 -06:00
..
comments Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
expression Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
module Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
other Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
pattern Update Rust to v1.77 (#10510) 2024-03-21 12:10:33 -04:00
snapshots Remove exception-handler lexing from `unused-bound-exception` fix (#5851) 2023-07-18 18:27:46 +00:00
statement Reduce size of Stmt from 144 to 120 bytes (#11051) 2024-04-19 17:02:17 -06:00
string Simplify formatting of strings by using flags from the AST nodes (#10489) 2024-03-20 16:16:54 +00:00
type_param Don't move type param opening parenthesis comment (#8163) 2023-10-24 12:02:27 +00:00
builders.rs Refactor with statement formatting to have explicit layouts (#10296) 2024-03-08 18:40:39 -05:00
cli.rs Remove type parameter from `parse_*` methods (#9466) 2024-01-11 19:41:19 +01:00
context.rs chore: remove repetitive words (#10502) 2024-03-21 03:57:16 +00:00
generated.rs Remove `Expr` postfix from `ExprNamed`, `ExprIf`, and `ExprGenerator` (#10229) 2024-03-04 12:55:01 +01:00
lib.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
main.rs Formatter and parser refactoring (#7569) 2023-09-26 15:29:43 +02:00
options.rs Preview minimal f-string formatting (#9642) 2024-02-16 20:28:11 +05:30
prelude.rs Accept any `Into<AnyNodeRef>` as `Comments` arguments (#5205) 2023-06-20 16:49:21 +00:00
preview.rs Formatter: Improve single-with item formatting for Python 3.8 or older (#10276) 2024-03-08 23:56:02 +00:00
range.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
shared_traits.rs ruff_python_formatter: copy and inline shared traits (#8656) 2023-11-13 12:16:04 -05:00
verbatim.rs Preview minimal f-string formatting (#9642) 2024-02-16 20:28:11 +05:30