ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.96k stars 274 forks source link

style: use std::fmt instead of importing Debug and Display #1087

Closed joshka closed 2 months ago

joshka commented 2 months ago

Based on a discussion with @EdJoPaTo on a PR.

This is a small universal style change to avoid making this change a part of other PRs.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.1%. Comparing base (5f1e119) to head (de8fd50).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1087 +/- ## ===================================== Coverage 94.1% 94.1% ===================================== Files 61 61 Lines 14619 14619 ===================================== Hits 13764 13764 Misses 855 855 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

joshka commented 2 months ago

Lint error is fixed in https://github.com/ratatui-org/ratatui/pull/1088

EdJoPaTo commented 2 months ago

I would have went with std::fmt::Debug as it only affects two likes to use std::fmt instead of fmt and is a bit more concise on what exactly was impl here.

also side note: merging quickly prevents more feedback. Especially when PR are open for weeks normally.

joshka commented 2 months ago

I would have went with std::fmt::Debug as it only affects two likes to use std::fmt instead of fmt and is a bit more concise on what exactly was impl here.

use std::fmt comes directly from the docs, which I'd treat as idiomatic (as well as being aligned with what I see as subjectively tasteful).

also side note: merging quickly prevents more feedback. Especially when PR are open for weeks normally.

Agreed. Apologies. I should have waited. Ideally PRs shouldn't be hitting weeks, but I understand that's been happening a bit more than usual lately. To some extent all the other maintainers have had various travel plans / other stuff going on in their life.