diff --git a/Rust/source/src/idgen/snow_worker_m1.rs b/Rust/source/src/idgen/snow_worker_m1.rs index c6f63f7..bdd1eec 100644 --- a/Rust/source/src/idgen/snow_worker_m1.rs +++ b/Rust/source/src/idgen/snow_worker_m1.rs @@ -93,7 +93,7 @@ impl SnowWorkerM1 { // 5.MaxSeqNumber let mut maxSeqNumber = (1 << options.SeqBitLength) - 1; - if options.maxSeqNumber <= 0 { + if options.MaxSeqNumber <= 0 { maxSeqNumber = 63; } if options.MaxSeqNumber < 0 || options.MaxSeqNumber > maxSeqNumber { diff --git a/Rust/source/src/lib.rs b/Rust/source/src/lib.rs index f3b770d..18cc0e1 100644 --- a/Rust/source/src/lib.rs +++ b/Rust/source/src/lib.rs @@ -4,7 +4,6 @@ mod idgen; // extern crate lazy_static; extern crate libc; -use libc::{c_char, uint32_t}; use std::ffi::{CStr, CString}; use std::str; pub use idgen::*; diff --git a/Rust/source/src/main.rs b/Rust/source/src/main.rs index 382b577..75f5a33 100644 --- a/Rust/source/src/main.rs +++ b/Rust/source/src/main.rs @@ -31,7 +31,8 @@ fn main() { while i < times { i += 1; - YitIdHelper::NextId(); + id = YitIdHelper::NextId(); + println!("id: {}", id); // if multiThread { // 这是多线程 // thread::spawn(move || {