8 lines
188 B
Rust
8 lines
188 B
Rust
use std::io::Cursor;
|
|
use std::path::Path;
|
|
|
|
pub fn read_entire_file(path:impl AsRef<Path>)->Result<Cursor<Vec<u8>>,std::io::Error>{
|
|
let data=std::fs::read(path)?;
|
|
Ok(Cursor::new(data))
|
|
}
|