fix(doc): do not access deprecated Cell::symbol field in doc example (#626)

This commit is contained in:
Linda_pp 2023-11-13 23:29:01 +09:00 committed by GitHub
parent edacaf7ff4
commit ec7b3872b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");
/// ```