maple_lib

Crates.iomaple_lib
lib.rsmaple_lib
version0.1.4
sourcesrc
created_at2023-03-28 17:10:08.390576
updated_at2023-12-23 05:59:23.512164
descriptionA simple tools library for MapleImage.
homepage
repositoryhttps://github.com/Robert-Ro/learning-rust/tree/main/projects/tools
max_upload_size
id823233
size6,449
Liutsing Robert (Robert-Ro)

documentation

README

Maple lib tools

A simple tools library for MapleImage.

usage

Add this to your Cargo.toml:

[dependencies]
maple_lib = "0.1.3"

Examples

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);

publish

cargo publish --registry crates-io
# 然后输入.env中的密钥即可
Commit count: 0

cargo fmt