From e44b64952287fb3f6443950af49d97178b52a16a Mon Sep 17 00:00:00 2001 From: AuroraTea <1352685369@qq.com> Date: Sat, 17 Dec 2022 22:26:21 +0800 Subject: [PATCH] docs: highlight code blocks `Rust` readme.md --- Rust/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Rust/README.md b/Rust/README.md index bed9f5d..398a2d5 100644 --- a/Rust/README.md +++ b/Rust/README.md @@ -3,7 +3,7 @@ ## 调用示例(Rust) 第1步,**全局** 初始化(应用程序启动时执行一次): -``` +```rust // 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId: let mut options = IdGeneratorOptions::New(Your_Unique_Worker_Id); // options.WorkerIdBitLength = 10; // 默认值6,限定 WorkerId 最大值为2^6-1,即默认最多支持64个节点。 @@ -18,9 +18,7 @@ YitIdHelper::SetIdGenerator(options); ``` 第2步,生成ID: -``` +```rust // 初始化后,在任何需要生成ID的地方,调用以下方法: long newId = YitIdHelper::NextId(); -``` - - +``` \ No newline at end of file