Crates.io | cdumay_core |
lib.rs | cdumay_core |
version | 0.0.1 |
source | src |
created_at | 2024-07-17 13:35:34.824894 |
updated_at | 2024-07-17 13:35:34.824894 |
description | Bundle of utils |
homepage | https://github.com/cdumay/rust-cdumay_core |
repository | https://github.com/cdumay/rust-cdumay_core |
max_upload_size | |
id | 1306181 |
size | 6,492 |
cdumay_core is a bundle of tools used by other libraries.
Cargo.toml:
[dependencies]
cdumay_core = "0.3"
serde_json = "1.0"
main.rs:
extern crate cdumay_core;
extern crate serde_json;
use cdumay_core::{Value, Uuid};
fn main() {
let data = r#"
{
"name": "John Doe",
"age": 43
}"#;
let v: Value = serde_json::from_str(data).unwrap();
assert_eq!(v["name"], "John Doe");
assert_eq!(v["age"], 43);
let uuid = Uuid::new_v4();
println!("{}", serde_json::to_string_pretty(&uuid).unwrap());
}