doc:补充一些函数的文档。

This commit is contained in:
徐涛
2023-07-03 22:39:32 +08:00
parent e6447fdd43
commit d1c19355a5
2 changed files with 28 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
pub mod hail;
pub mod uuid {
/// 生成一个UUID v4字符串。
pub fn new() -> Box<String> {
Box::from(uuid::Uuid::new_v4().to_string())
}
@@ -8,6 +9,8 @@ pub mod uuid {
pub mod short_uuid {
const STR_SRC: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
/// 生成一个基于UUID v4的短UUID字符串。
pub fn new(length: i16) -> Box<String> {
let length = if length < 2 {
2