diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/anstyle/src | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/anstyle/src')
-rw-r--r-- | vendor/anstyle/src/color.rs | 68 | ||||
-rw-r--r-- | vendor/anstyle/src/style.rs | 74 |
2 files changed, 1 insertions, 141 deletions
diff --git a/vendor/anstyle/src/color.rs b/vendor/anstyle/src/color.rs index b56d13ebd..40fa7dfa9 100644 --- a/vendor/anstyle/src/color.rs +++ b/vendor/anstyle/src/color.rs @@ -119,23 +119,6 @@ impl From<(u8, u8, u8)> for Color { } } -/// Define style with specified foreground color and effects -/// -/// # Examples -/// -/// ```rust -/// let fg = anstyle::Color::from((0, 0, 0)); -/// let style = fg | anstyle::Effects::BOLD | anstyle::Effects::UNDERLINE; -/// ``` -impl core::ops::BitOr<crate::Effects> for Color { - type Output = crate::Style; - - #[inline(always)] - fn bitor(self, rhs: crate::Effects) -> Self::Output { - crate::Style::new().fg_color(Some(self)) | rhs - } -} - /// Available 4-bit ANSI color palette codes /// /// The user's terminal defines the meaning of the each palette code. @@ -337,23 +320,6 @@ impl AnsiColor { } } -/// Define style with specified foreground color and effects -/// -/// # Examples -/// -/// ```rust -/// let fg = anstyle::AnsiColor::Black; -/// let style = fg | anstyle::Effects::BOLD | anstyle::Effects::UNDERLINE; -/// ``` -impl core::ops::BitOr<crate::Effects> for AnsiColor { - type Output = crate::Style; - - #[inline(always)] - fn bitor(self, rhs: crate::Effects) -> Self::Output { - crate::Style::new().fg_color(Some(self.into())) | rhs - } -} - /// 256 (8-bit) color support /// /// - `0..16` are [`AnsiColor`] palette codes @@ -479,23 +445,6 @@ impl From<AnsiColor> for Ansi256Color { } } -/// Define style with specified foreground color and effects -/// -/// # Examples -/// -/// ```rust -/// let fg = anstyle::Ansi256Color(0); -/// let style = fg | anstyle::Effects::BOLD | anstyle::Effects::UNDERLINE; -/// ``` -impl core::ops::BitOr<crate::Effects> for Ansi256Color { - type Output = crate::Style; - - #[inline(always)] - fn bitor(self, rhs: crate::Effects) -> Self::Output { - crate::Style::new().fg_color(Some(self.into())) | rhs - } -} - /// 24-bit ANSI RGB color codes #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RgbColor(pub u8, pub u8, pub u8); @@ -587,23 +536,6 @@ impl From<(u8, u8, u8)> for RgbColor { } } -/// Define style with specified foreground color and effects -/// -/// # Examples -/// -/// ```rust -/// let fg = anstyle::RgbColor(0, 0, 0); -/// let style = fg | anstyle::Effects::BOLD | anstyle::Effects::UNDERLINE; -/// ``` -impl core::ops::BitOr<crate::Effects> for RgbColor { - type Output = crate::Style; - - #[inline(always)] - fn bitor(self, rhs: crate::Effects) -> Self::Output { - crate::Style::new().fg_color(Some(self.into())) | rhs - } -} - #[derive(Default, Debug)] struct DisplayBuffer { buffer: [u8; 19], diff --git a/vendor/anstyle/src/style.rs b/vendor/anstyle/src/style.rs index 623d7c732..e0cad29d2 100644 --- a/vendor/anstyle/src/style.rs +++ b/vendor/anstyle/src/style.rs @@ -290,62 +290,6 @@ impl Style { } } -/// Define style with specified foreground color -/// -/// # Examples -/// -/// ```rust -/// let style: anstyle::Style = anstyle::Color::from((0, 0, 0)).into(); -/// ``` -impl From<crate::Color> for Style { - #[inline] - fn from(color: crate::Color) -> Self { - Self::new().fg_color(Some(color)) - } -} - -/// Define style with specified foreground color -/// -/// # Examples -/// -/// ```rust -/// let style: anstyle::Style = anstyle::AnsiColor::Black.into(); -/// ``` -impl From<crate::AnsiColor> for Style { - #[inline] - fn from(color: crate::AnsiColor) -> Self { - Self::new().fg_color(Some(color.into())) - } -} - -/// Define style with specified foreground color -/// -/// # Examples -/// -/// ```rust -/// let style: anstyle::Style = anstyle::Ansi256Color(0).into(); -/// ``` -impl From<crate::Ansi256Color> for Style { - #[inline] - fn from(color: crate::Ansi256Color) -> Self { - Self::new().fg_color(Some(color.into())) - } -} - -/// Define style with specified foreground color -/// -/// # Examples -/// -/// ```rust -/// let style: anstyle::Style = anstyle::RgbColor(0, 0, 0).into(); -/// ``` -impl From<crate::RgbColor> for Style { - #[inline] - fn from(color: crate::RgbColor) -> Self { - Self::new().fg_color(Some(color.into())) - } -} - /// # Examples /// /// ```rust @@ -417,26 +361,10 @@ impl core::ops::SubAssign<crate::Effects> for Style { /// # Examples /// /// ```rust -/// let color = anstyle::RgbColor(0, 0, 0); -/// assert_eq!(anstyle::Style::new().fg_color(Some(color.into())), color); -/// assert_ne!(color | anstyle::Effects::BOLD, color); -/// ``` -impl<C: Into<crate::Color> + Clone> core::cmp::PartialEq<C> for Style { - #[inline] - fn eq(&self, other: &C) -> bool { - let other = other.clone().into(); - let other = Self::from(other); - *self == other - } -} - -/// # Examples -/// -/// ```rust /// let effects = anstyle::Effects::BOLD; /// assert_eq!(anstyle::Style::new().effects(effects), effects); /// assert_ne!(anstyle::Effects::UNDERLINE | effects, effects); -/// assert_ne!(anstyle::RgbColor(0, 0, 0) | effects, effects); +/// assert_ne!(anstyle::RgbColor(0, 0, 0).on_default() | effects, effects); /// ``` impl core::cmp::PartialEq<crate::Effects> for Style { #[inline] |