Skip to content

Commit

Permalink
Expose accessors on LitBool consistent with other Lit variants
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 5, 2021
1 parent de1a51d commit b2f1da2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down

0 comments on commit b2f1da2

Please sign in to comment.