diff --git a/CHANGELOG.md b/CHANGELOG.md index ee50296..db17669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ +# 1.9.3 (February 24, 2020) +- Fix compilation regression for 1.34.0. Thanks @jlevon for reporting. + # 1.9.2 (January 11, 2020) - Exposed `ColoredString` data through methods for purposes of interrogating the applied colours. - Increased documentation. diff --git a/src/lib.rs b/src/lib.rs index 9f9f57d..fe70a08 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -308,7 +308,7 @@ impl ColoredString { /// assert_eq!(cstr.fgcolor(), None); /// ``` pub fn fgcolor(&self) -> Option { - self.fgcolor.as_ref().copied() + self.fgcolor.as_ref().map(|x| *x) } /// Get the current background color applied. @@ -321,7 +321,7 @@ impl ColoredString { /// assert_eq!(cstr.bgcolor(), None); /// ``` pub fn bgcolor(&self) -> Option { - self.bgcolor.as_ref().copied() + self.bgcolor.as_ref().map(|x| *x) } /// Get the current [`Style`] which can be check if it contains a [`Styles`].