1
0
mirror of synced 2025-12-12 16:18:15 +08:00

fix(rust): [cr_id_skip] Fix compilation exceptions

修复rust编译异常
This commit is contained in:
tqq1994516
2024-10-29 07:38:00 +00:00
parent e06fc2db93
commit 36861f5b68
3 changed files with 3 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ impl SnowWorkerM1 {
// 5.MaxSeqNumber // 5.MaxSeqNumber
let mut maxSeqNumber = (1 << options.SeqBitLength) - 1; let mut maxSeqNumber = (1 << options.SeqBitLength) - 1;
if options.maxSeqNumber <= 0 { if options.MaxSeqNumber <= 0 {
maxSeqNumber = 63; maxSeqNumber = 63;
} }
if options.MaxSeqNumber < 0 || options.MaxSeqNumber > maxSeqNumber { if options.MaxSeqNumber < 0 || options.MaxSeqNumber > maxSeqNumber {

View File

@@ -4,7 +4,6 @@ mod idgen;
// extern crate lazy_static; // extern crate lazy_static;
extern crate libc; extern crate libc;
use libc::{c_char, uint32_t};
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use std::str; use std::str;
pub use idgen::*; pub use idgen::*;

View File

@@ -31,7 +31,8 @@ fn main() {
while i < times { while i < times {
i += 1; i += 1;
YitIdHelper::NextId(); id = YitIdHelper::NextId();
println!("id: {}", id);
// if multiThread { // 这是多线程 // if multiThread { // 这是多线程
// thread::spawn(move || { // thread::spawn(move || {