We have a \'delete all my data\' feature. I\'d like to delete a set of IPs from many many web log files.
Currently at runtime I open a CSV with the IP addresses to d
have only a single static binary to deploy
Inline your entire CSV file using include! or include_str! and then go about the rest of your program as usual.
use csv; // 1.0.5
static CSV_FILE: &[u8] = include_bytes!("/etc/hosts");
fn main() -> Result<(), Box> {
let mut rdr = csv::ReaderBuilder::new()
.delimiter(b'\t')
.from_reader(CSV_FILE);
for result in rdr.records() {
let record = result?;
println!("{:?}", record);
}
Ok(())
}
See also: