chore: add more CompactString::const_new instead of new (#1230)

This commit is contained in:
Josh McKinney 2024-07-15 20:29:32 -07:00 committed by GitHub
parent 6d210b3b6b
commit 7bab9f0d80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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")]