I think this is the most common pattern:
while (stdin.takeDelimiterExclusive('\n')) |line| {
// do stuff with line
} else |err| {
if (err != error.EndOfStream) return err;
// handle other errors if needed.
}
}
I think this is the most common pattern:
while (stdin.takeDelimiterExclusive('\n')) |line| {
// do stuff with line
} else |err| {
if (err != error.EndOfStream) return err;
// handle other errors if needed.
}
}