-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use inner Display implementation #1097
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
=====================================
Coverage 94.2% 94.2%
=====================================
Files 61 61
Lines 14530 14533 +3
=====================================
+ Hits 13693 13696 +3
Misses 837 837 ☔ View full report in Codecov by Sentry. |
This allows for `format!("{:>42})` formatting. See https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.pad
3dc256f
to
5141cba
Compare
Added tests, and switched to use formatter.pad instead of the calling display on the inner value. |
Personally I use |
It's not worth changing this back, noting it as a not worth changing for future PRs. |
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.pad
I 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