I\'m trying to read some lines from a file, skipping the first few and printing the rest, but I keep getting errors about used value after move:
use std::fs:
In order to avoid the move, use the Read::by_ref() method. That way, you only borrow the BufReader:
BufReader
for (index, line) in buffer.by_ref().lines().enumerate() { ... } // ^^^^^^^^^ // you can still use `buffer` here