mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 04:33:13 +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
|
||||
/// 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.
|
||||
pub const fn new(symbol: &'static str) -> Self {
|
||||
Self {
|
||||
|
@ -139,7 +139,7 @@ impl Cell {
|
|||
|
||||
/// Resets the cell to the empty state.
|
||||
pub fn reset(&mut self) {
|
||||
self.symbol = CompactString::new(" ");
|
||||
self.symbol = CompactString::const_new(" ");
|
||||
self.fg = Color::Reset;
|
||||
self.bg = Color::Reset;
|
||||
#[cfg(feature = "underline-color")]
|
||||
|
@ -167,7 +167,7 @@ mod tests {
|
|||
assert_eq!(
|
||||
cell,
|
||||
Cell {
|
||||
symbol: CompactString::new("あ"),
|
||||
symbol: CompactString::const_new("あ"),
|
||||
fg: Color::Reset,
|
||||
bg: Color::Reset,
|
||||
#[cfg(feature = "underline-color")]
|
||||
|
|
Loading…
Reference in a new issue