pub fn read_file_contents(path: &Path) -> Result<FileContents, Box<dyn Error>>Expand description
Reads file contents, decompressing if needed.
Detection strategy:
- Read first 2 bytes to check magic bytes.
- If gzip: decompress entire file to a String.
- If uncompressed and < 64 KiB:
read_to_string. - If uncompressed and >= 64 KiB: memory-mapped I/O.