fix(rust): [cr_id_skip] Fix compilation exceptions
修复rust编译异常
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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::*;
|
||||||
|
|||||||
@@ -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 || {
|
||||||
|
|||||||
Reference in New Issue
Block a user