Read entire file as u8


#1

I’m having trouble googling this. Is there a builtin function that takes a &str or a std::fs::File, and return the entire file as Vec ?


#2

Yes, a free function in the fs module:

https://doc.rust-lang.org/std/fs/fn.read.html


#3

@scottmcm : Great; thanks! It even links to read_to_end which turns out to work even better in this case. Thanks!