I have the following code to read from a file:
let mut buf: Box<[u8]> = Box::new([0; 1024 * 1024]);
while let Ok(n) = f.read(&mut buf) {
if n > 0 {
resp.send_data(&buf[0..n]);
} else {
break;
}
}
But it causes:
fatal runtime error: stack overflow
I am on OS X 10.11 with Rust 1.12.0.