fn main() {}
//use cocoon::Cocoon;
//use serde::{Deserialize, Serialize};
/*
use std::collections::HashMap;
//use std::fs::File;
use std::path::{Path, PathBuf};

struct Secrets {
    filename: PathBuf,
    data: HashMap<String, String>,
}

impl Secrets {
    pub fn new(filename: &Path, password: &str) -> Self {
        let mut data = HashMap::<String, String>::new();
        if filename.exists() {}

        Secrets {
            filename: filename.to_path_buf(),
            data: HashMap::new(),
        }
    }

    pub fn save(&self) {}
}

fn main() {
    let filename = PathBuf::from("target/test.db");
    if filename.exists() {
        std::fs::remove_file(&filename);
    }

    let mut pwds = Secrets::new(&filename, "secret");
    pwds.data.insert(
        "my.email@example.com".to_string(),
        "eKPV$PM8TV5A2".to_string(),
    );

    pwds.save();
}
*/
/*
let mut db = Database {
    inner: HashMap::new(),
};

// Over time you collect some kind of data.
db.inner.insert(
    "my.email@example.com".to_string(),
    "eKPV$PM8TV5A2".to_string(),
);

// You can choose how to serialize data. Also, you can compress it.
let json = serde_json::to_string_pretty(&db).unwrap();
println!("{}",json);
//let encoded = db.try_to_vec().unwrap();

// Finally, you want to store your data secretly.
// Supply some password to Cocoon: password is any byte array, basically.
// Don't use a hard-coded password in real life!
// It could be a user-supplied password.
let cocoon = Cocoon::new(b"secret password");

// Dump the serialized database into a file as an encrypted container.
{
let mut file = File::create("target/test.db").unwrap();
let container = cocoon.dump(json.clone().into_bytes(), &mut file).unwrap();
}

let cocoon2 = Cocoon::new(b" secret password");

let mut file = File::open("target/test.db").unwrap();
match cocoon2.parse(&mut file) {
    Ok(bytes) => {
        let json2 = std::str::from_utf8(&bytes).unwrap();

println!("{}", &json2);
assert_eq!(&json2, &json.to_string());
    },
    Err(e) =>{
        println!("{:?}",e);
    }
}*/
//}
