pub enum Comment {
Line(String),
Block(String),
}Expand description
A recovered ////* */ comment, remembering which delimiter style the source used so a
formatter can reproduce it instead of normalizing every comment to one style.
Variants§
Line(String)
A line comment’s text — its // and surrounding whitespace stripped. A producer that
merges a run of consecutive // lines (e.g. adam-lang’s trivia recovery) stores them
joined with \n; cel-parser’s scan_gap emits one Line per // line.
Block(String)
A /* text */ block comment (single- or multi-line), inner text \n-joined with the
outer /*/*/ delimiters and per-line indentation stripped. Nested delimiters remain.
Trait Implementations§
impl Eq for Comment
impl StructuralPartialEq for Comment
Auto Trait Implementations§
impl Freeze for Comment
impl RefUnwindSafe for Comment
impl Send for Comment
impl Sync for Comment
impl Unpin for Comment
impl UnsafeUnpin for Comment
impl UnwindSafe for Comment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more