Closed EdJoPaTo closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.2%. Comparing base (
699c2d7
) to head (b28e7c4
). Report is 4 commits behind head on main.:exclamation: Current head b28e7c4 differs from pull request most recent head d2dd6e4. Consider uploading reports for the commit d2dd6e4 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Added tests, and switched to use formatter.pad instead of the calling display on the inner value. nit: This is somewhere where I'd generally feel fine using a single letter parameter name as that's idiomatic throughout the entire std lib whenever a debug / display impl is written.
nit: This is somewhere where I'd generally feel fine using a single letter parameter name as that's idiomatic throughout the entire std lib whenever a debug / display impl is written.
Personally I use fmt
but so far I also used core::fmt::…
so I'm not sure how much the similar names confuses in such a case. I have clippy::min_ident_chars
enabled which is annoyed at the single character here so I change it regularly. We can use f
in ratatui, I disable that lint in ratatui anyway as its very annoying here.
nit: This is somewhere where I'd generally feel fine using a single letter parameter name as that's idiomatic throughout the entire std lib whenever a debug / display impl is written.
Personally I use
fmt
but so far I also usedcore::fmt::…
so I'm not sure how much the similar names confuses in such a case. I haveclippy::min_ident_chars
enabled which is annoyed at the single character here so I change it regularly. We can usef
in ratatui, I disable that lint in ratatui anyway as its very annoying here.
It's not worth changing this back, noting it as a not worth changing for future PRs.
as that's idiomatic throughout the entire std lib
They are also not that aligned with more speaking variable / function names and like to abbreviate way more often than I like. I remember being annoyed by the lack of clear names in the std lib when I started with Rust as that was more confusing than necessary in my opinion. After all, most people use language servers with completion.
as that's idiomatic throughout the entire std lib
They are also not that aligned with more speaking variable / function names and like to abbreviate way more often than I like. I remember being annoyed by the lack of clear names in the std lib when I started with Rust as that was more confusing than necessary in my opinion. After all, most people use language servers with completion.
I'm also a "nvr abbrv." opinion holder generally, so I see your point on this. I always rename f to frame whenever I see it in ratatui code, because it poorly communicates what the value is for readers. When faced with choosing idiom vs opinion, I tend towards accepting the former most of the time.
This allows for
format!("{:>42})
formatting. See https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.padI am not very attached to this. It feels more correct to reuse the inner Display implementation but we can also drop this. Main reason for this PR was to move it out of #1007