Skip to content

Commit b2f1da2

Browse files
committed
Expose accessors on LitBool consistent with other Lit variants
1 parent de1a51d commit b2f1da2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/lit.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,24 @@ impl Display for LitFloat {
505505
}
506506
}
507507

508+
impl LitBool {
509+
pub fn new(value: bool, span: Span) -> Self {
510+
LitBool { value, span }
511+
}
512+
513+
pub fn value(&self) -> bool {
514+
self.value
515+
}
516+
517+
pub fn span(&self) -> Span {
518+
self.span
519+
}
520+
521+
pub fn set_span(&mut self, span: Span) {
522+
self.span = span;
523+
}
524+
}
525+
508526
#[cfg(feature = "extra-traits")]
509527
mod debug_impls {
510528
use super::*;

0 commit comments

Comments
 (0)