diff --git a/crates/msr-core/Cargo.toml b/crates/msr-core/Cargo.toml index c3daf03..628c81b 100644 --- a/crates/msr-core/Cargo.toml +++ b/crates/msr-core/Cargo.toml @@ -21,7 +21,7 @@ csv = { version = "1.1.6", optional = true, default-features = false } serde = { version = "1.0.145", optional = true, default-features = false } serde_json = { version = "1.0.85", optional = true, default-features = false } thread-priority = { version = "0.9.2", optional = true, default-features = false } -uuid = { version = "1.1.2", optional = true, default-features = false } +ulid = { version = "1.0.0", optional = true } [target.'cfg(loom)'.dependencies] loom = "0.5.6" @@ -30,7 +30,7 @@ loom = "0.5.6" default = [] full = ["csv-event-journal", "csv-register-recorder", "realtime-worker-thread"] serde = ["dep:serde", "time/serde-well-known"] -event-journal = ["serde/derive", "bs58/std", "uuid/v4"] +event-journal = ["serde/derive", "ulid"] register-recorder = ["serde/derive", "bs58/std"] csv-storage = ["serde", "csv"] csv-event-journal = ["event-journal", "csv-storage"] diff --git a/crates/msr-core/src/event_journal/mod.rs b/crates/msr-core/src/event_journal/mod.rs index 1adb647..053a16d 100644 --- a/crates/msr-core/src/event_journal/mod.rs +++ b/crates/msr-core/src/event_journal/mod.rs @@ -4,7 +4,7 @@ use std::{fmt, num::NonZeroUsize, time::SystemTime}; use serde::{Deserialize, Serialize}; use thiserror::Error; -use uuid::Uuid; +use ulid::Ulid; use crate::{ storage::{ @@ -280,7 +280,7 @@ pub struct DefaultRecordPreludeGenerator; impl RecordPreludeGenerator for DefaultRecordPreludeGenerator { fn generate_prelude(&self) -> Result<(SystemInstant, RecordPrelude)> { - let id = RecordId::from(bs58::encode(Uuid::new_v4().as_bytes()).into_string()); + let id = RecordId::from(Ulid::new().to_string()); Ok(( SystemInstant::now(), RecordPrelude {