mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 12:43:16 +00:00
chore: add more CompactString::const_new instead of new (#1230)
This commit is contained in:
parent
6d210b3b6b
commit
7bab9f0d80
1 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ impl Cell {
|
||||||
///
|
///
|
||||||
/// This works at compile time and puts the symbol onto the stack. Fails to build when the
|
/// This works at compile time and puts the symbol onto the stack. Fails to build when the
|
||||||
/// symbol doesnt fit onto the stack and requires to be placed on the heap. Use
|
/// symbol doesnt fit onto the stack and requires to be placed on the heap. Use
|
||||||
/// `Self::default().set_symbol()` in that case. See [`CompactString::new_inline`] for more
|
/// `Self::default().set_symbol()` in that case. See [`CompactString::const_new`] for more
|
||||||
/// details on this.
|
/// details on this.
|
||||||
pub const fn new(symbol: &'static str) -> Self {
|
pub const fn new(symbol: &'static str) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -139,7 +139,7 @@ impl Cell {
|
||||||
|
|
||||||
/// Resets the cell to the empty state.
|
/// Resets the cell to the empty state.
|
||||||
pub fn reset(&mut self) {
|
pub fn reset(&mut self) {
|
||||||
self.symbol = CompactString::new(" ");
|
self.symbol = CompactString::const_new(" ");
|
||||||
self.fg = Color::Reset;
|
self.fg = Color::Reset;
|
||||||
self.bg = Color::Reset;
|
self.bg = Color::Reset;
|
||||||
#[cfg(feature = "underline-color")]
|
#[cfg(feature = "underline-color")]
|
||||||
|
@ -167,7 +167,7 @@ mod tests {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cell,
|
cell,
|
||||||
Cell {
|
Cell {
|
||||||
symbol: CompactString::new("あ"),
|
symbol: CompactString::const_new("あ"),
|
||||||
fg: Color::Reset,
|
fg: Color::Reset,
|
||||||
bg: Color::Reset,
|
bg: Color::Reset,
|
||||||
#[cfg(feature = "underline-color")]
|
#[cfg(feature = "underline-color")]
|
||||||
|
|
Loading…
Reference in a new issue