From ec7b3872b46c6828c88ce7f72308dc67731fca25 Mon Sep 17 00:00:00 2001 From: Linda_pp Date: Mon, 13 Nov 2023 23:29:01 +0900 Subject: [PATCH] fix(doc): do not access deprecated `Cell::symbol` field in doc example (#626) --- src/buffer.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/buffer.rs b/src/buffer.rs index 495c7dcd..a41f2309 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -145,16 +145,13 @@ impl Default for Cell { /// let mut buf = Buffer::empty(Rect{x: 0, y: 0, width: 10, height: 5}); /// buf.get_mut(0, 2).set_symbol("x"); /// assert_eq!(buf.get(0, 2).symbol(), "x"); +/// /// buf.set_string(3, 0, "string", Style::default().fg(Color::Red).bg(Color::White)); -/// assert_eq!(buf.get(5, 0), &Cell{ -/// symbol: String::from("r"), -/// fg: Color::Red, -/// bg: Color::White, -/// #[cfg(feature = "underline-color")] -/// underline_color: Color::Reset, -/// modifier: Modifier::empty(), -/// skip: false -/// }); +/// let cell = buf.get_mut(5, 0); +/// assert_eq!(cell.symbol(), "r"); +/// assert_eq!(cell.fg, Color::Red); +/// assert_eq!(cell.bg, Color::White); +/// /// buf.get_mut(5, 0).set_char('x'); /// assert_eq!(buf.get(5, 0).symbol(), "x"); /// ```