From 6d0eaef9c0b7f669437a9f8e50080e230c2b8a71 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sun, 11 Jul 2021 17:04:46 -0400 Subject: [PATCH] make option builder methods const --- src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0cab96c..014ca14 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,7 +172,6 @@ impl Default for Options<'_> { } } -#[allow(clippy::missing_const_for_fn)] impl<'a> Options<'a> { /// `grass` currently offers 2 different output styles /// @@ -183,7 +182,7 @@ impl<'a> Options<'a> { /// By default, output is expanded. #[must_use] #[inline] - pub fn style(mut self, style: OutputStyle) -> Self { + pub const fn style(mut self, style: OutputStyle) -> Self { self.style = style; self } @@ -197,7 +196,7 @@ impl<'a> Options<'a> { /// By default, this value is `false` and warnings are emitted. #[must_use] #[inline] - pub fn quiet(mut self, quiet: bool) -> Self { + pub const fn quiet(mut self, quiet: bool) -> Self { self.quiet = quiet; self } @@ -243,7 +242,7 @@ impl<'a> Options<'a> { /// contains any non-ASCII characters. #[must_use] #[inline] - pub fn allows_charset(mut self, allows_charset: bool) -> Self { + pub const fn allows_charset(mut self, allows_charset: bool) -> Self { self.allows_charset = allows_charset; self } @@ -257,7 +256,7 @@ impl<'a> Options<'a> { /// This flag does not affect the CSS output. #[must_use] #[inline] - pub fn unicode_error_messages(mut self, unicode_error_messages: bool) -> Self { + pub const fn unicode_error_messages(mut self, unicode_error_messages: bool) -> Self { self.unicode_error_messages = unicode_error_messages; self }