mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-01 06:51:53 +00:00
perf(cell): use const CompactString::new_inline (#979)
Some minor find when messing around trying to `const` all the things. While `reset()` and `default()` can not be `const` it's still a benefit when their contents are.
This commit is contained in:
parent
88bfb5a430
commit
541f0f9953
@ -114,7 +114,7 @@ impl Cell {
|
|||||||
|
|
||||||
/// Resets the cell to the default state.
|
/// Resets the cell to the default state.
|
||||||
pub fn reset(&mut self) {
|
pub fn reset(&mut self) {
|
||||||
self.symbol = CompactString::new(" ");
|
self.symbol = CompactString::new_inline(" ");
|
||||||
self.fg = Color::Reset;
|
self.fg = Color::Reset;
|
||||||
self.bg = Color::Reset;
|
self.bg = Color::Reset;
|
||||||
#[cfg(feature = "underline-color")]
|
#[cfg(feature = "underline-color")]
|
||||||
@ -129,7 +129,7 @@ impl Cell {
|
|||||||
impl Default for Cell {
|
impl Default for Cell {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
symbol: CompactString::new(" "),
|
symbol: CompactString::new_inline(" "),
|
||||||
fg: Color::Reset,
|
fg: Color::Reset,
|
||||||
bg: Color::Reset,
|
bg: Color::Reset,
|
||||||
#[cfg(feature = "underline-color")]
|
#[cfg(feature = "underline-color")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user