mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 07:21:24 +00:00
fix: sparkline docs / doc tests (#1437)
This commit is contained in:
parent
514d273875
commit
611086eba4
@ -47,7 +47,8 @@ use crate::{
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use ratatui::{
|
/// use ratatui::{
|
||||||
/// style::{Style, Stylize},
|
/// style::{Color, Style, Stylize},
|
||||||
|
/// symbols,
|
||||||
/// widgets::{Block, RenderDirection, Sparkline},
|
/// widgets::{Block, RenderDirection, Sparkline},
|
||||||
/// };
|
/// };
|
||||||
///
|
///
|
||||||
@ -123,6 +124,8 @@ impl<'a> Sparkline<'a> {
|
|||||||
/// your own type that implements [`Into<Style>`]).
|
/// your own type that implements [`Into<Style>`]).
|
||||||
///
|
///
|
||||||
/// The foreground corresponds to the bars while the background is everything else.
|
/// The foreground corresponds to the bars while the background is everything else.
|
||||||
|
///
|
||||||
|
/// [`Color`]: crate::style::Color
|
||||||
#[must_use = "method moves the value of self and returns the modified value"]
|
#[must_use = "method moves the value of self and returns the modified value"]
|
||||||
pub fn absent_value_style<S: Into<Style>>(mut self, style: S) -> Self {
|
pub fn absent_value_style<S: Into<Style>>(mut self, style: S) -> Self {
|
||||||
self.absent_value_style = style.into();
|
self.absent_value_style = style.into();
|
||||||
@ -265,6 +268,8 @@ impl SparklineBar {
|
|||||||
/// As well as the style of the sparkline, each [`SparklineBar`] may optionally set its own
|
/// As well as the style of the sparkline, each [`SparklineBar`] may optionally set its own
|
||||||
/// style. If set, the style of the bar will be the style of the sparkline combined with
|
/// style. If set, the style of the bar will be the style of the sparkline combined with
|
||||||
/// the style of the bar.
|
/// the style of the bar.
|
||||||
|
///
|
||||||
|
/// [`Color`]: crate::style::Color
|
||||||
#[must_use = "method moves the value of self and returns the modified value"]
|
#[must_use = "method moves the value of self and returns the modified value"]
|
||||||
pub fn style<S: Into<Option<Style>>>(mut self, style: S) -> Self {
|
pub fn style<S: Into<Option<Style>>>(mut self, style: S) -> Self {
|
||||||
self.style = style.into();
|
self.style = style.into();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user