diff --git a/Cargo.toml b/Cargo.toml index 47d01a9a..bb3ce9df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ rust-version = "1.74.0" [dependencies] bitflags = "2.3" cassowary = "0.3" -compact_str = "0.7.1" +compact_str = "0.8.0" crossterm = { version = "0.27", optional = true } document-features = { version = "0.2.7", optional = true } instability = "0.3.1" diff --git a/src/buffer/cell.rs b/src/buffer/cell.rs index b034349f..9c4309d3 100644 --- a/src/buffer/cell.rs +++ b/src/buffer/cell.rs @@ -43,9 +43,9 @@ impl Cell { /// 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 /// details on this. - pub const fn new(symbol: &str) -> Self { + pub const fn new(symbol: &'static str) -> Self { Self { - symbol: CompactString::new_inline(symbol), + symbol: CompactString::const_new(symbol), fg: Color::Reset, bg: Color::Reset, #[cfg(feature = "underline-color")] @@ -139,7 +139,7 @@ impl Cell { /// Resets the cell to the empty state. pub fn reset(&mut self) { - self.symbol = CompactString::new_inline(" "); + self.symbol = CompactString::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_inline("あ"), + symbol: CompactString::new("あ"), fg: Color::Reset, bg: Color::Reset, #[cfg(feature = "underline-color")]