From ade7dfcacf31c5554332366f9e476fea9250adcd Mon Sep 17 00:00:00 2001 From: John Lewis Date: Mon, 26 Feb 2024 13:17:15 -0600 Subject: [PATCH] fix: remove bare `ulid` dep from `bl` --- Cargo.lock | 1 - crates/bl/Cargo.toml | 2 -- crates/bl/src/upload.rs | 8 ++++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c88784..fe78e78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -580,7 +580,6 @@ dependencies = [ "surrealdb", "thiserror", "tracing", - "ulid", ] [[package]] diff --git a/crates/bl/Cargo.toml b/crates/bl/Cargo.toml index 421c9c8..1a0ada5 100644 --- a/crates/bl/Cargo.toml +++ b/crates/bl/Cargo.toml @@ -21,7 +21,6 @@ image = { workspace = true, optional = true } qrcode = { workspace = true, optional = true } tracing = { workspace = true, optional = true } surrealdb = { workspace = true, optional = true } -ulid = { workspace = true, optional = true } [features] default = [] @@ -29,5 +28,4 @@ hydrate = [ "leptos/hydrate" ] ssr = [ "core_types/ssr", "leptos/ssr", "dep:clients", "dep:artifact", "dep:base64", "dep:color-eyre", "dep:image", "dep:qrcode", "dep:tracing", "dep:surrealdb", - "dep:ulid", ] diff --git a/crates/bl/src/upload.rs b/crates/bl/src/upload.rs index 6aa5247..4f9de5d 100644 --- a/crates/bl/src/upload.rs +++ b/crates/bl/src/upload.rs @@ -4,7 +4,7 @@ use clients::surreal::SurrealRootClient; use color_eyre::eyre::Result; use core_types::{ Photo, PhotoArtifacts, PhotoGroup, PhotoGroupStatus, PrivateArtifact, - PublicArtifact, + PublicArtifact, Ulid, }; use serde::{Deserialize, Serialize}; use surrealdb::opt::PatchOp; @@ -83,9 +83,9 @@ pub async fn upload_single_photo( // create a photo and upload it to surreal let photo = Photo { - id: core_types::PhotoRecordId(ulid::Ulid::new()), + id: core_types::PhotoRecordId(Ulid::new()), // this is set to nil because we don't have a group yet - group: core_types::PhotoGroupRecordId(ulid::Ulid::nil()), + group: core_types::PhotoGroupRecordId(Ulid::nil()), artifacts: PhotoArtifacts { original: core_types::PrivateImageArtifact { artifact_id: original_artifact.id, @@ -114,7 +114,7 @@ pub async fn upload_single_photo( // create a photo group and upload it to surreal let group = PhotoGroup { - id: core_types::PhotoGroupRecordId(ulid::Ulid::new()), + id: core_types::PhotoGroupRecordId(Ulid::new()), owner: user_id, photographer: user_id, photos: vec![photo.id],