implemented for loops

This commit is contained in:
2025-04-20 05:16:50 -04:00
parent d741854f5f
commit 11353b2d69
27 changed files with 360 additions and 174 deletions

View File

@@ -71,16 +71,12 @@ impl CharDequeUtils for VecDeque<char> {
impl TkVecUtils<Tk> for Vec<Tk> {
fn get_span(&self) -> Option<Span> {
if let Some(first_tk) = self.first() {
if let Some(last_tk) = self.last() {
Some(
Span::new(
first_tk.span.start..last_tk.span.end,
first_tk.source()
)
self.last().map(|last_tk| {
Span::new(
first_tk.span.start..last_tk.span.end,
first_tk.source()
)
} else {
None
}
})
} else {
None
}