Compresses the given data to a gzip format.
(data: &[u8])
| 902 | |
| 903 | /// Compresses the given data to a gzip format. |
| 904 | pub fn compress_to_gzip(data: &[u8]) -> Vec<u8> { |
| 905 | let mut encoder = GzEncoder::new(Vec::new(), Compression::best()); |
| 906 | encoder.write_all(data).expect("Failed to write data"); |
| 907 | encoder.finish().expect("Failed to finish compression") |
| 908 | } |
| 909 | |
| 910 | /// Creates a file in the `assets` folder with the given name and content. |
| 911 | pub fn create_file(name: &str, content: &[u8]) { |
no outgoing calls