mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 20:53:19 +00:00
728f82c084
* refactor: add Line type to replace Spans `Line` is a significantly better name over `Spans` as the plural causes confusion and the type really is a representation of a line of text made up of spans. This is a backwards compatible version of the approach from https://github.com/tui-rs-revival/ratatui/pull/175 There is a significant amount of code that uses the Spans type and methods, so instead of just renaming it, we add a new type and replace parameters that accepts a `Spans` with a parameter that accepts `Into<Line>`. Note that the examples have been intentionally left using `Spans` in this commit to demonstrate the compiler warnings that will be emitted in existing code. Implementation notes: - moves the Spans code to text::spans and publicly reexports on the text module. This makes the test in that module only relevant to the Spans type. - adds a line module with a copy of the code and tests from Spans with a single addition: `impl<'a> From<Spans<'a>> for Line<'a>` - adds tests for `Spans` (created and checked before refactoring) - adds the same tests for `Line` - updates all widget methods that accept and store Spans to instead store `Line` and accept `Into<Line>` * refactor: move text::Masked to text::masked::Masked Re-exports the Masked type at text::Masked * refactor: replace Spans with Line in tests/examples/docs |
||
---|---|---|
.. | ||
app.rs | ||
crossterm.rs | ||
main.rs | ||
termion.rs | ||
termwiz.rs | ||
ui.rs |