Skip to content

Commit b416a09

Browse files
Update uuid crate to v1
1 parent b934f82 commit b416a09

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqlx-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ time = { version = "0.3.2", features = ["macros", "formatting", "parsing"], opti
173173
tokio-stream = { version = "0.1.8", features = ["fs"], optional = true }
174174
smallvec = "1.7.0"
175175
url = { version = "2.2.2", default-features = false }
176-
uuid = { version = "0.8.2", default-features = false, optional = true, features = ["std"] }
176+
uuid = { version = "1.0", default-features = false, optional = true, features = ["std"] }
177177
webpki-roots = { version = "0.22.0", optional = true }
178178
whoami = { version = "1.2.1", optional = true }
179179
stringprep = "0.1.2"

sqlx-core/src/mysql/types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
//! | Rust type | MySQL type(s) |
6363
//! |---------------------------------------|------------------------------------------------------|
6464
//! | `uuid::Uuid` | BYTE(16), VARCHAR, CHAR, TEXT |
65-
//! | `uuid::adapter::Hyphenated` | CHAR(36) |
65+
//! | `uuid::fmt::Hyphenated` | CHAR(36) |
6666
//!
6767
//! ### [`json`](https://crates.io/crates/json)
6868
//!

sqlx-core/src/mysql/types/uuid.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use uuid::{adapter::Hyphenated, Uuid};
1+
use uuid::{fmt::Hyphenated, Uuid};
22

33
use crate::decode::Decode;
44
use crate::encode::{Encode, IsNull};
@@ -61,6 +61,6 @@ impl Decode<'_, MySql> for Hyphenated {
6161
// parse a UUID from the text
6262
Uuid::parse_str(text)
6363
.map_err(Into::into)
64-
.map(|u| u.to_hyphenated())
64+
.map(|u| u.hyphenated())
6565
}
6666
}

sqlx-core/src/sqlite/types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! | Rust type | Sqlite type(s) |
3636
//! |---------------------------------------|------------------------------------------------------|
3737
//! | `uuid::Uuid` | BLOB, TEXT |
38-
//! | `uuid::adapter::Hyphenated` | TEXT |
38+
//! | `uuid::fmt::Hyphenated` | TEXT |
3939
//!
4040
//! # Nullable
4141
//!

sqlx-core/src/sqlite/types/uuid.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::sqlite::type_info::DataType;
55
use crate::sqlite::{Sqlite, SqliteArgumentValue, SqliteTypeInfo, SqliteValueRef};
66
use crate::types::Type;
77
use std::borrow::Cow;
8-
use uuid::{adapter::Hyphenated, Uuid};
8+
use uuid::{fmt::Hyphenated, Uuid};
99

1010
impl Type<Sqlite> for Uuid {
1111
fn type_info() -> SqliteTypeInfo {
@@ -53,6 +53,6 @@ impl Decode<'_, Sqlite> for Hyphenated {
5353
let uuid: Result<Uuid, BoxDynError> =
5454
Uuid::parse_str(&value.text().map(ToOwned::to_owned)?).map_err(Into::into);
5555

56-
Ok(uuid?.to_hyphenated())
56+
Ok(uuid?.hyphenated())
5757
}
5858
}

tests/mysql/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ test_type!(uuid<sqlx::types::Uuid>(MySql,
5151
));
5252

5353
#[cfg(feature = "uuid")]
54-
test_type!(uuid_hyphenated<sqlx::types::uuid::adapter::Hyphenated>(MySql,
54+
test_type!(uuid_hyphenated<sqlx::types::uuid::fmt::Hyphenated>(MySql,
5555
"'b731678f-636f-4135-bc6f-19440c13bd19'"
56-
== sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap().to_hyphenated(),
56+
== sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap().hyphenated(),
5757
"'00000000-0000-0000-0000-000000000000'"
58-
== sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().to_hyphenated()
58+
== sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().hyphenated()
5959
));
6060

6161
#[cfg(feature = "chrono")]

tests/sqlite/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ test_type!(uuid<sqlx::types::Uuid>(Sqlite,
140140
));
141141

142142
#[cfg(feature = "uuid")]
143-
test_type!(uuid_hyphenated<sqlx::types::uuid::adapter::Hyphenated>(Sqlite,
143+
test_type!(uuid_hyphenated<sqlx::types::uuid::fmt::Hyphenated>(Sqlite,
144144
"'b731678f-636f-4135-bc6f-19440c13bd19'"
145-
== sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap().to_hyphenated(),
145+
== sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap().hyphenated(),
146146
"'00000000-0000-0000-0000-000000000000'"
147-
== sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().to_hyphenated()
147+
== sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().hyphenated()
148148
));

0 commit comments

Comments
 (0)