fn purge_command(matches: &ArgMatches) {
    if let Some(matches) = matches.subcommand_matches("purge") {
        if let Some(ref pass) = matches.value_of("password") {
            if let Some(ref id) = matches.value_of("id") {
                let snapshot = get_snapshot_path();
                let client: Client<Provider> = deserialize_from_snapshot(&snapshot, pass);

                let id = Vec::from_base64(id.as_bytes()).expect("couldn't convert the id to from base64");
                let id = Id::load(&id).expect("Couldn't build a new Id");

                client.revoke_record_by_id(id);
                client.perform_gc();

                assert!(client.db.take(|db| db.all().find(|i| i == &id).is_none()));

                let snapshot = get_snapshot_path();
                serialize_to_snapshot(&snapshot, pass, client);
            }
        }
    }
}
// Purge a record from the chain: revoke and then garbage collect.
Purge a record from the chain: revoke and then garbage collect.
Purge a record from the chain : revoke and then garbage collect .
fn purge_command(matches: &ArgMatches) {
    if let Some(matches) = matches.subcommand_matches("purge") {
        if let Some(ref pass) = matches.value_of("password") {
            if let Some(ref id) = matches.value_of("id") {
                let snapshot = get_snapshot_path();
                let client: Client<Provider> = deserialize_from_snapshot(&snapshot, pass);
                let id = Vec::from_base64(id.as_bytes()).expect("couldn't convert the id to from base64");
                let id = Id::load(&id).expect("Couldn't build a new Id");
                client.revoke_record_by_id(id);
                client.perform_gc();
                assert!(client.db.take(|db| db.all().find(|i| i == &id).is_none()));
                let snapshot = get_snapshot_path();
                serialize_to_snapshot(&snapshot, pass, client);
            }
        }
    }
}
fn purge_command ( matches : & ArgMatches ) { if let Some ( matches ) = matches . subcommand_matches ( " " ) { if let Some ( ref pass ) = matches . value_of ( " " ) { if let Some ( ref id ) = matches . value_of ( " " ) { let snapshot = get_snapshot_path ( ) ; let client : Client < Provider > = deserialize_from_snapshot ( & snapshot , pass ) ; let id = Vec :: from_base64 ( id . as_bytes ( ) ) . expect ( " " ) ; let id = Id :: load ( & id ) . expect ( " " ) ; client . revoke_record_by_id ( id ) ; client . perform_gc ( ) ; assert ! ( client db take ( db db all ( ) find ( i i id ) is_none ( ) ) ) ; let snapshot = get_snapshot_path ( ) ; serialize_to_snapshot ( & snapshot , pass , client ) ; } } } }
Purge a record from the chain: revoke and then garbage collect.
Purge a record from the chain : revoke and then garbage collect .
matches
&ArgMatches