Skip to content

Commit

Permalink
Merge pull request #119 from 9999years/cleanup
Browse files Browse the repository at this point in the history
Fix `clippy` and `doc` warnings
  • Loading branch information
jam1garner authored May 2, 2024
2 parents 57c3468 + 34f1809 commit 9d3f1b1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
48 changes: 24 additions & 24 deletions src/combo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ macro_rules! color_methods {
Fg: Color,
{
/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -89,8 +89,8 @@ macro_rules! color_methods {
}

/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand Down Expand Up @@ -148,8 +148,8 @@ macro_rules! color_methods {
Bg: Color,
{
/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -164,8 +164,8 @@ macro_rules! color_methods {
}

/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand Down Expand Up @@ -224,8 +224,8 @@ macro_rules! color_methods {
Bg: Color,
{
/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -240,8 +240,8 @@ macro_rules! color_methods {
}

/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand Down Expand Up @@ -356,8 +356,8 @@ color_methods! {

impl<'a, Fg: DynColor, T> FgDynColorDisplay<'a, Fg, T> {
/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -370,8 +370,8 @@ impl<'a, Fg: DynColor, T> FgDynColorDisplay<'a, Fg, T> {
}

/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -386,8 +386,8 @@ impl<'a, Fg: DynColor, T> FgDynColorDisplay<'a, Fg, T> {

impl<'a, Bg: DynColor, T> BgDynColorDisplay<'a, Bg, T> {
/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -400,8 +400,8 @@ impl<'a, Bg: DynColor, T> BgDynColorDisplay<'a, Bg, T> {
}

/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -416,8 +416,8 @@ impl<'a, Bg: DynColor, T> BgDynColorDisplay<'a, Bg, T> {

impl<'a, Fg: DynColor, Bg: DynColor, T> ComboDynColorDisplay<'a, Fg, Bg, T> {
/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -430,8 +430,8 @@ impl<'a, Fg: DynColor, Bg: DynColor, T> ComboDynColorDisplay<'a, Fg, Bg, T> {
}

/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand Down
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! |**Quick Links**|[`OwoColorize`](OwoColorize)|[`Style`]|[`StyledList`]|[`github`](https://github.com/jam1garner/owo-colors)|
//! |**Quick Links**|[`OwoColorize`]|[`Style`]|[`StyledList`]|[`github`](https://github.com/jam1garner/owo-colors)|
//! |-|-|-|-|-|
//!
//! ---
//!
//! This crate provides [`OwoColorize`](OwoColorize), an extension trait for colorizing a
//! This crate provides [`OwoColorize`], an extension trait for colorizing a
//! given type.
//!
//! ## Example
Expand Down Expand Up @@ -90,8 +90,8 @@ pub(crate) use overrides::OVERRIDE;
use core::fmt;
use core::marker::PhantomData;

/// A trait for describing a type which can be used with [`FgColorDisplay`](FgColorDisplay) or
/// [`BgColorDisplay`](BgColorDisplay)
/// A trait for describing a type which can be used with [`FgColorDisplay`] or
/// [`BgColorDisplay`]
pub trait Color {
/// The ANSI format code for setting this color as the foreground
const ANSI_FG: &'static str;
Expand All @@ -117,8 +117,8 @@ pub trait Color {
fn into_dyncolors() -> crate::DynColors;
}

/// A trait describing a runtime-configurable color which can displayed using [`FgDynColorDisplay`](FgDynColorDisplay)
/// or [`BgDynColorDisplay`](BgDynColorDisplay). If your color will be known at compile time it
/// A trait describing a runtime-configurable color which can displayed using [`FgDynColorDisplay`]
/// or [`BgDynColorDisplay`]. If your color will be known at compile time it
/// is recommended you avoid this.
pub trait DynColor {
/// A function to output a ANSI code to a formatter to set the foreground to this color
Expand All @@ -142,13 +142,13 @@ pub trait DynColor {

/// Transparent wrapper around a type which implements all the formatters the wrapped type does,
/// with the addition of changing the foreground color. Recommended to be constructed using
/// [`OwoColorize`](OwoColorize).
/// [`OwoColorize`].
#[repr(transparent)]
pub struct FgColorDisplay<'a, C: Color, T>(&'a T, PhantomData<C>);

/// Transparent wrapper around a type which implements all the formatters the wrapped type does,
/// with the addition of changing the background color. Recommended to be constructed using
/// [`OwoColorize`](OwoColorize).
/// [`OwoColorize`].
#[repr(transparent)]
pub struct BgColorDisplay<'a, C: Color, T>(&'a T, PhantomData<C>);

Expand Down Expand Up @@ -364,8 +364,8 @@ pub trait OwoColorize: Sized {
}

/// Set the foreground color at runtime. Only use if you do not know which color will be used at
/// compile-time. If the color is constant, use either [`OwoColorize::fg`](OwoColorize::fg) or
/// a color-specific method, such as [`OwoColorize::green`](OwoColorize::green),
/// compile-time. If the color is constant, use either [`OwoColorize::fg`] or
/// a color-specific method, such as [`OwoColorize::green`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand All @@ -379,8 +379,8 @@ pub trait OwoColorize: Sized {
}

/// Set the background color at runtime. Only use if you do not know what color to use at
/// compile-time. If the color is constant, use either [`OwoColorize::bg`](OwoColorize::bg) or
/// a color-specific method, such as [`OwoColorize::on_yellow`](OwoColorize::on_yellow),
/// compile-time. If the color is constant, use either [`OwoColorize::bg`] or
/// a color-specific method, such as [`OwoColorize::on_yellow`],
///
/// ```rust
/// use owo_colors::{OwoColorize, AnsiColors};
Expand Down

0 comments on commit 9d3f1b1

Please sign in to comment.