diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
commit | e02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch) | |
tree | fd60ebbbb5299e16e5fca8c773ddb74f764760db /vendor/anstyle | |
parent | Adding debian version 1.73.0+dfsg1-1. (diff) | |
download | rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/anstyle')
-rw-r--r-- | vendor/anstyle/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/anstyle/Cargo.lock | 2 | ||||
-rw-r--r-- | vendor/anstyle/Cargo.toml | 4 | ||||
-rw-r--r-- | vendor/anstyle/examples/dump.rs | 9 | ||||
-rw-r--r-- | vendor/anstyle/src/color.rs | 35 | ||||
-rw-r--r-- | vendor/anstyle/src/effect.rs | 3 | ||||
-rw-r--r-- | vendor/anstyle/src/reset.rs | 3 | ||||
-rw-r--r-- | vendor/anstyle/src/style.rs | 5 |
8 files changed, 31 insertions, 32 deletions
diff --git a/vendor/anstyle/.cargo-checksum.json b/vendor/anstyle/.cargo-checksum.json index fbf010c6c..3fa9255a7 100644 --- a/vendor/anstyle/.cargo-checksum.json +++ b/vendor/anstyle/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"0afd491ec728e98a5258056e95610a470958151437feaf798897f3925fdf18a8","Cargo.toml":"0c56a3526842d6b1a2d44e4ff70816cf450843340b72d24cb037e1b6ed1668ac","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"3dad3b7606dec7ce40f54546e0dd485aeb52a45d4fcdfdaf830fd8349bbe43a5","README.md":"dcb157ba695dd8f1572944cc5bf84b8f67f8bb73925a5b725a9e274c755ce1a6","examples/dump.rs":"8ccbdc02b3f939109e436c26cf7550a75d0cb6aefb59ae6ae6a59b61f0d358b4","src/color.rs":"0ded90669e83fff64ea7b2f79c6c6de79537e2b432b997e233d5807f0646b319","src/effect.rs":"c622c5472ba34d368a25341ce9488674b1e8516704aba80ae308e04b28136cd5","src/lib.rs":"0106395ba7263dbee67458e5ff4038cab493a3d34f3dcf0cb75504b1531a58e1","src/macros.rs":"0c90b45626fe8331d5b3326abb831f4ba6e04bcc975b1b9c01e465715050caa2","src/reset.rs":"65658e159fdf8f018bcfe6fdcfff688dbc4f3579fe1c685abdf92af6267165f8","src/style.rs":"f17ae53e38a3551ee8e3092f259aadfafabd3103e2db7fb3af291241dc6b8f46"},"package":"3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"}
\ No newline at end of file +{"files":{"Cargo.lock":"ccf805a1b70ac0205b4a5f39db4c21ff2b6c2420d58120f5b74ebd574de3beed","Cargo.toml":"cecc5e02aafb4fa8bcbbcd64eb0c91fada8bcb6ca2514504540e01227295b7b1","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"3dad3b7606dec7ce40f54546e0dd485aeb52a45d4fcdfdaf830fd8349bbe43a5","README.md":"dcb157ba695dd8f1572944cc5bf84b8f67f8bb73925a5b725a9e274c755ce1a6","examples/dump.rs":"236dd2a3dce7512d1faeda5caec8d272299441b5d204696957940c687a021be8","src/color.rs":"8ac17093415630424ab61ca7a674aa98c39438bee51ae9d294072b1d2b17e743","src/effect.rs":"64573c03643af32ed5efe941ccdecb3f4c89685db1b4fbf35a0803e0347f06ee","src/lib.rs":"0106395ba7263dbee67458e5ff4038cab493a3d34f3dcf0cb75504b1531a58e1","src/macros.rs":"0c90b45626fe8331d5b3326abb831f4ba6e04bcc975b1b9c01e465715050caa2","src/reset.rs":"8f8c2f996e5f446d2bbcfb9926494fb2ad76701260225ab6b627960c53dfcb59","src/style.rs":"fecf7c3fcdd00a26727c62861f4ce532ff80df0e0c6a9b4e288d3d2a3d1e4d65"},"package":"7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"}
\ No newline at end of file diff --git a/vendor/anstyle/Cargo.lock b/vendor/anstyle/Cargo.lock index fb61f4d79..fa7fd90b6 100644 --- a/vendor/anstyle/Cargo.lock +++ b/vendor/anstyle/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" dependencies = [ "lexopt", ] diff --git a/vendor/anstyle/Cargo.toml b/vendor/anstyle/Cargo.toml index b58e6b9c5..8bb0f30e4 100644 --- a/vendor/anstyle/Cargo.toml +++ b/vendor/anstyle/Cargo.toml @@ -11,9 +11,9 @@ [package] edition = "2021" -rust-version = "1.64.0" +rust-version = "1.70.0" name = "anstyle" -version = "1.0.1" +version = "1.0.4" include = [ "build.rs", "src/**/*", diff --git a/vendor/anstyle/examples/dump.rs b/vendor/anstyle/examples/dump.rs index a37a04893..1221cd6c7 100644 --- a/vendor/anstyle/examples/dump.rs +++ b/vendor/anstyle/examples/dump.rs @@ -66,19 +66,14 @@ struct Args { layer: Layer, } -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Default)] enum Layer { + #[default] Fg, Bg, Underline, } -impl Default for Layer { - fn default() -> Self { - Layer::Fg - } -} - impl Args { fn parse() -> Result<Self, lexopt::Error> { use lexopt::prelude::*; diff --git a/vendor/anstyle/src/color.rs b/vendor/anstyle/src/color.rs index cbf0b47a2..8dcf6ca5b 100644 --- a/vendor/anstyle/src/color.rs +++ b/vendor/anstyle/src/color.rs @@ -17,13 +17,13 @@ impl Color { /// Create a [`Style`][crate::Style] with this as the foreground #[inline] - pub fn on_default(self) -> crate::Style { + pub const fn on_default(self) -> crate::Style { crate::Style::new().fg_color(Some(self)) } /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display { + pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { match self { Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_fg_str()), Self::Ansi256(color) => color.as_fg_buffer(), @@ -44,7 +44,7 @@ impl Color { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display { + pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { match self { Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_bg_str()), Self::Ansi256(color) => color.as_bg_buffer(), @@ -64,7 +64,7 @@ impl Color { } #[inline] - pub(crate) fn render_underline(self) -> impl core::fmt::Display { + pub(crate) fn render_underline(self) -> impl core::fmt::Display + Copy + Clone { match self { Self::Ansi(color) => color.as_underline_buffer(), Self::Ansi256(color) => color.as_underline_buffer(), @@ -185,13 +185,13 @@ impl AnsiColor { /// Create a [`Style`][crate::Style] with this as the foreground #[inline] - pub fn on_default(self) -> crate::Style { - crate::Style::new().fg_color(Some(self.into())) + pub const fn on_default(self) -> crate::Style { + crate::Style::new().fg_color(Some(Color::Ansi(self))) } /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display { + pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { self.as_fg_str() } @@ -219,7 +219,7 @@ impl AnsiColor { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display { + pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { self.as_bg_str() } @@ -340,8 +340,8 @@ impl Ansi256Color { /// Create a [`Style`][crate::Style] with this as the foreground #[inline] - pub fn on_default(self) -> crate::Style { - crate::Style::new().fg_color(Some(self.into())) + pub const fn on_default(self) -> crate::Style { + crate::Style::new().fg_color(Some(Color::Ansi256(self))) } #[inline] @@ -396,7 +396,7 @@ impl Ansi256Color { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display { + pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { self.as_fg_buffer() } @@ -410,7 +410,7 @@ impl Ansi256Color { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display { + pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { self.as_bg_buffer() } @@ -460,8 +460,8 @@ impl RgbColor { /// Create a [`Style`][crate::Style] with this as the foreground #[inline] - pub fn on_default(self) -> crate::Style { - crate::Style::new().fg_color(Some(self.into())) + pub const fn on_default(self) -> crate::Style { + crate::Style::new().fg_color(Some(Color::Rgb(self))) } #[inline] @@ -481,7 +481,7 @@ impl RgbColor { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display { + pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { self.as_fg_buffer() } @@ -499,7 +499,7 @@ impl RgbColor { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display { + pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { self.as_bg_buffer() } @@ -536,7 +536,7 @@ impl From<(u8, u8, u8)> for RgbColor { } } -#[derive(Default, Debug)] +#[derive(Copy, Clone, Default, Debug)] struct DisplayBuffer { buffer: [u8; 19], len: usize, @@ -598,6 +598,7 @@ impl core::fmt::Display for DisplayBuffer { } #[cfg(test)] +#[cfg(feature = "std")] mod test { use super::*; diff --git a/vendor/anstyle/src/effect.rs b/vendor/anstyle/src/effect.rs index d31dafe82..56b3e615c 100644 --- a/vendor/anstyle/src/effect.rs +++ b/vendor/anstyle/src/effect.rs @@ -156,7 +156,7 @@ impl Effects { /// Render the ANSI code #[inline] - pub fn render(self) -> impl core::fmt::Display { + pub fn render(self) -> impl core::fmt::Display + Copy + Clone { EffectsDisplay(self) } @@ -307,6 +307,7 @@ pub(crate) const METADATA: [Metadata; 12] = [ }, ]; +#[derive(Copy, Clone, Default, Debug)] struct EffectsDisplay(Effects); impl core::fmt::Display for EffectsDisplay { diff --git a/vendor/anstyle/src/reset.rs b/vendor/anstyle/src/reset.rs index 5f5f2b461..c8c214093 100644 --- a/vendor/anstyle/src/reset.rs +++ b/vendor/anstyle/src/reset.rs @@ -5,11 +5,12 @@ pub struct Reset; impl Reset { /// Render the ANSI code #[inline] - pub fn render(self) -> impl core::fmt::Display { + pub fn render(self) -> impl core::fmt::Display + Copy + Clone { ResetDisplay } } +#[derive(Copy, Clone, Default, Debug)] struct ResetDisplay; impl core::fmt::Display for ResetDisplay { diff --git a/vendor/anstyle/src/style.rs b/vendor/anstyle/src/style.rs index e0cad29d2..f4da242b3 100644 --- a/vendor/anstyle/src/style.rs +++ b/vendor/anstyle/src/style.rs @@ -92,7 +92,7 @@ impl Style { /// Render the ANSI code #[inline] - pub fn render(self) -> impl core::fmt::Display { + pub fn render(self) -> impl core::fmt::Display + Copy + Clone { StyleDisplay(self) } @@ -121,7 +121,7 @@ impl Style { /// /// Unlike [`Reset::render`][crate::Reset::render], this will elide the code if there is nothing to reset. #[inline] - pub fn render_reset(self) -> impl core::fmt::Display { + pub fn render_reset(self) -> impl core::fmt::Display + Copy + Clone { if self != Self::new() { RESET } else { @@ -374,6 +374,7 @@ impl core::cmp::PartialEq<crate::Effects> for Style { } } +#[derive(Copy, Clone, Default, Debug)] struct StyleDisplay(Style); impl core::fmt::Display for StyleDisplay { |