From 7bbbfd046324363c8db1fb15d39aeb02fe7331b5 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 21 Mar 2021 14:10:24 -0600 Subject: hilarious and original joke --- examples/toml2json.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'examples/toml2json.rs') diff --git a/examples/toml2json.rs b/examples/toml2json.rs index 1b90c9f..6e02e8b 100644 --- a/examples/toml2json.rs +++ b/examples/toml2json.rs @@ -6,7 +6,7 @@ use std::io; use std::io::prelude::*; use serde_json::Value as Json; -use toml::Value as Toml; +use milf::Value as Milf; fn main() { let mut args = env::args(); @@ -21,27 +21,27 @@ fn main() { } match input.parse() { - Ok(toml) => { - let json = convert(toml); + Ok(milf) => { + let json = convert(milf); println!("{}", serde_json::to_string_pretty(&json).unwrap()); } - Err(error) => println!("failed to parse TOML: {}", error), + Err(error) => println!("failed to parse MILF: {}", error), } } -fn convert(toml: Toml) -> Json { - match toml { - Toml::String(s) => Json::String(s), - Toml::Integer(i) => Json::Number(i.into()), - Toml::Float(f) => { +fn convert(milf: Milf) -> Json { + match milf { + Milf::String(s) => Json::String(s), + Milf::Integer(i) => Json::Number(i.into()), + Milf::Float(f) => { let n = serde_json::Number::from_f64(f).expect("float infinite and nan not allowed"); Json::Number(n) } - Toml::Boolean(b) => Json::Bool(b), - Toml::Array(arr) => Json::Array(arr.into_iter().map(convert).collect()), - Toml::Table(table) => { + Milf::Boolean(b) => Json::Bool(b), + Milf::Array(arr) => Json::Array(arr.into_iter().map(convert).collect()), + Milf::Table(table) => { Json::Object(table.into_iter().map(|(k, v)| (k, convert(v))).collect()) } - Toml::Datetime(dt) => Json::String(dt.to_string()), + Milf::Datetime(dt) => Json::String(dt.to_string()), } } -- cgit v1.2.3