mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-25 22:20:31 +00:00
8f56fabcdd
* feat: accept Color and Modifier for all Styles All style related methods now accept `S: Into<Style>` instead of `Style`. `Color` and `Modifier` implement `Into<Style>` so this is allows for more ergonomic usage. E.g.: ```rust Line::styled("hello", Style::new().red()); Line::styled("world", Style::new().bold()); // can now be simplified to Line::styled("hello", Color::Red); Line::styled("world", Modifier::BOLD); ``` Fixes https://github.com/ratatui-org/ratatui/issues/694 BREAKING CHANGE: All style related methods now accept `S: Into<Style>` instead of `Style`. This means that if you are already passing an ambiguous type that implements `Into<Style>` you will need to remove the `.into()` call. `Block` style methods can no longer be called from a const context as trait functions cannot (yet) be const. * feat: add tuple conversions to Style Adds conversions for various Color and Modifier combinations * chore: add unit tests
10 lines
190 B
Rust
10 lines
190 B
Rust
#![warn(missing_docs)]
|
|
//! A module for the [`Buffer`] and [`Cell`] types.
|
|
|
|
mod assert;
|
|
#[allow(clippy::module_inception)]
|
|
mod buffer;
|
|
mod cell;
|
|
|
|
pub use buffer::Buffer;
|
|
pub use cell::Cell;
|