| Crates.io | maple_lib |
| lib.rs | maple_lib |
| version | 0.1.4 |
| created_at | 2023-03-28 17:10:08.390576+00 |
| updated_at | 2023-12-23 05:59:23.512164+00 |
| description | A simple tools library for MapleImage. |
| homepage | |
| repository | https://github.com/Robert-Ro/learning-rust/tree/main/projects/tools |
| max_upload_size | |
| id | 823233 |
| size | 6,449 |
A simple tools library for MapleImage.
Add this to your Cargo.toml:
[dependencies]
maple_lib = "0.1.3"
use maple_lib::human_format;
use std::time::Duration;
let result = human_format(Duration::from_secs(59));
assert_eq!(result, "00h:00m:59s");
use maple_lib::pad_start;
let result = pad_start("hello", 10, ' ');
assert_eq!(result, " hello");
use maple_lib::execution_time;
let result = execution_time(|| {
1+1
});
assert_eq!(result.0, 1);
cargo publish --registry crates-io
# 然后输入.env中的密钥即可