Skip to content

Commit

Permalink
feat(deps): remove vendored uuidv6 dep
Browse files Browse the repository at this point in the history
Now that the PR to
rust-uuidv6 (jedisct1/rust-uuidv6#1), it looks
like we can remove the vendored code that added support for outputting
bytes.

This commit removes the vendored code and uses a published version of uuidv6.

Signed-off-by: vados <[email protected]>
  • Loading branch information
t3hmrman committed Oct 30, 2023
1 parent e10879b commit 9c2cf66
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 157 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ sonyflake = "0.2.0"
timeflake-rs = "0.3.0"
ulid = "1.1.0"
uuid7 = "0.7.2"
uuidv6 = "0.1.2"
xid = "1.0.3"
miette = { version = "5.10.0", features = ["fancy"] }

Expand Down
1 change: 0 additions & 1 deletion src/cuid.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::io;

use chrono::{Datelike, NaiveDateTime, Timelike};
use cuid;
use pgrx::*;

use crate::common::OrPgxError;
Expand Down
3 changes: 1 addition & 2 deletions src/cuid2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use cuid2;
use pgrx::*;

/// Generate a random cuid2 UUID
Expand Down Expand Up @@ -28,4 +27,4 @@ mod tests {
let generated = crate::cuid2::idkit_cuid2_generate();
assert_eq!(generated.len(), 24);
}
}
}
2 changes: 1 addition & 1 deletion src/nanoid.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use pgrx::*;
use nanoid::nanoid;
use pgrx::*;

/// Generate a nanoid
#[pg_extern]
Expand Down
8 changes: 2 additions & 6 deletions src/uuid_v6.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use pgrx::*;

mod vendor;
use vendor::{Node, UUIDv6};
use uuidv6::{self, Node, RawUUIDv6, UUIDv6};

/// Generate a UUID v6
#[pg_extern]
Expand All @@ -21,9 +19,7 @@ fn idkit_uuidv6_generate_text() -> String {
fn idkit_uuidv6_generate_uuid() -> pgrx::Uuid {
let node = Node::new();

// This depends on PR to rust-uuidv6
// see: https://github.com/jedisct1/rust-uuidv6/pull/1
pgrx::Uuid::from_slice(&UUIDv6::new(&node).create_bytes())
pgrx::Uuid::from_slice(&RawUUIDv6::new(&node).create())
.unwrap_or_else(|e| error!("{}", format!("failed to generate/parse uuidv6: {}", e)))
}

Expand Down
147 changes: 0 additions & 147 deletions src/uuid_v6/vendor.rs

This file was deleted.

0 comments on commit 9c2cf66

Please sign in to comment.