feat(line): implement iterators for Line (#896)
This allows iterating over the `Span`s of a line using `for` loops and other iterator methods. - add `iter` and `iter_mut` methods to `Line` - implement `IntoIterator` for `Line`, `&Line`, and `&mut Line` traits - update call sites to iterate over `Line` rather than `Line::spans`
This commit is contained in:
@@ -243,7 +243,7 @@ impl Buffer {
|
||||
pub fn set_line(&mut self, x: u16, y: u16, line: &Line<'_>, width: u16) -> (u16, u16) {
|
||||
let mut remaining_width = width;
|
||||
let mut x = x;
|
||||
for span in &line.spans {
|
||||
for span in line {
|
||||
if remaining_width == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user