adds From<uuid::Uuid> for sql::Value and sql::Uuid (#1398)

This commit is contained in:
Aman Sharma 2022-10-24 14:13:50 +05:30 committed by GitHub
parent 50a2c25688
commit 01858bf4ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -22,6 +22,12 @@ impl From<&str> for Uuid {
}
}
impl From<uuid::Uuid> for Uuid{
fn from(v: uuid::Uuid) -> Self {
Uuid(v)
}
}
impl From<String> for Uuid {
fn from(s: String) -> Self {
Self::from(s.as_str())

View file

@ -155,6 +155,12 @@ impl From<Uuid> for Value {
}
}
impl From<uuid::Uuid> for Value{
fn from(v: uuid::Uuid) -> Self {
Value::Uuid(Uuid(v))
}
}
impl From<Param> for Value {
fn from(v: Param) -> Self {
Value::Param(v)