commit e388a24af038e201332b16f8bf9f6739bfa7a001 parent 13eb7cdca7db468a6432e6e7a91b3e6fbf1051c2 Author: alex wennerberg <alex@alexwennerberg.com> Date: Sat, 8 Jan 2022 14:59:24 -0800 remove ini.rs Diffstat:
D | ini.rs | | | 32 | -------------------------------- |
1 file changed, 0 insertions(+), 32 deletions(-)
diff --git a/ini.rs b/ini.rs @@ -1,32 +0,0 @@ -use std::fs::File; -use std::io::{self, BufRead}; -use std::path::Path; - -// Parse very simple configuration files of the form key=value - -fn main() -> std::io::Result<()> { - let filename = "test.ini"; - let file = File::open(filename)?; - for l in io::BufReader::new(file).lines() { - let line = l?; - if line.len() == 0 { - continue; - } - if let Some(i) = line.find('=') { - let key = &line[..i]; - let value = &line[i + 1..]; - match key { - "foo" => { - let foo = value; - println!("{}", foo); - } - _ => {} - } - // Debug line - } else { - // Replace with whatever you want to do on malformed config lines - panic!("Invalid config") - } - } - Ok(()) -}