From b2f1da284d666ec59571033807f46a8c082330cb Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 4 Mar 2021 18:01:58 -0800 Subject: [PATCH] Expose accessors on LitBool consistent with other Lit variants --- src/lit.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lit.rs b/src/lit.rs index d67ee88426..0aa50a590c 100644 --- a/src/lit.rs +++ b/src/lit.rs @@ -505,6 +505,24 @@ impl Display for LitFloat { } } +impl LitBool { + pub fn new(value: bool, span: Span) -> Self { + LitBool { value, span } + } + + pub fn value(&self) -> bool { + self.value + } + + pub fn span(&self) -> Span { + self.span + } + + pub fn set_span(&mut self, span: Span) { + self.span = span; + } +} + #[cfg(feature = "extra-traits")] mod debug_impls { use super::*;