More impls for to_node

This commit is contained in:
Joshua Warner 2024-12-19 12:04:43 -05:00
parent dbbd097708
commit 3a7265baed
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
2 changed files with 22 additions and 0 deletions

View file

@ -40,6 +40,16 @@ impl<'a, T: Copy> ExtractSpaces<'a> for Spaces<'a, T> {
}
}
impl<'a, T> Spaces<'a, T> {
pub fn item(item: T) -> Self {
Self {
before: &[],
item,
after: &[],
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct SpacesBefore<'a, T> {
pub before: &'a [CommentOrNewline<'a>],