Will Woods @wizard.zone · Mar 1

Anyway! `/x.py test library/std` takes a while but all the tests pass. Great work Rust folks, high-fives all around, &c. Now let's see if I can trigger the problem. Let's look at BufReader::peek() and its doctest: github.com/rust-lang/ru...

2 likes 1 replies

?

Replies

Will Woods · Mar 1

What the doctest does: 1. Make a Reader (`bytes`) containing 9 bytes: "oh, hello" 2. Wrap it in a BufReader (`buf`) with a 6-byte capacity 3. peek(2) - this causes a buffer fill. buf contains "oh, he". 4. read 4 bytes: "oh, ". buf now contains "he". 5. peek(2) - just returns "he". (cont'd..)