Skip to content

Commit

Permalink
docs(anstyle): Document Style's new Display functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett authored and epage committed Jan 29, 2024
1 parent 03a3823 commit da0569e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/anstyle/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ use crate::reset::RESET;

/// ANSI Text styling
///
/// You can print a `Style` to render the corresponding ANSI code.
/// Using the alternate flag `#` will render the ANSI reset code, if needed.
/// Together, this makes it convenient to render styles using inline format arguments.
///
/// # Examples
///
/// ```rust
/// let style = anstyle::Style::new().bold();
///
/// let value = 42;
/// println!("{style}{value}{style:#}");
/// ```
#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Style {
Expand Down

0 comments on commit da0569e

Please sign in to comment.