i am silly
This commit is contained in:
parent
471161c1a3
commit
a8a1284ae1
@ -30,13 +30,11 @@ fn main() {
|
|||||||
|
|
||||||
let file = Path::new(&input);
|
let file = Path::new(&input);
|
||||||
if file.is_file() {
|
if file.is_file() {
|
||||||
let mut content = String::new();
|
|
||||||
File::open(file).expect("").read_to_string(&mut content).unwrap();
|
File::open(file).expect("").read_to_string(&mut content).unwrap();
|
||||||
println!("{}", content);
|
|
||||||
} else { content = input.to_string(); }
|
} else { content = input.to_string(); }
|
||||||
|
|
||||||
let keyval: Vec<&str> = arguments[1].split(".").collect();
|
let keyval: Vec<&str> = arguments[1].split(".").collect();
|
||||||
let mut toml = content.parse::<Value>().unwrap();
|
let toml = content.parse::<Value>().unwrap();
|
||||||
|
|
||||||
match toml.get(keyval[1]) {
|
match toml.get(keyval[1]) {
|
||||||
Some(value) => println!("{}", value),
|
Some(value) => println!("{}", value),
|
||||||
|
Loading…
Reference in New Issue
Block a user