mirror of
https://github.com/uuid-rs/uuid.git
synced 2025-09-28 13:31:58 +00:00
Add impl From<Uuid> for String under std feature
This commit is contained in:
parent
97b7f07b3e
commit
22fcf03299
10
src/fmt.rs
10
src/fmt.rs
@ -16,6 +16,9 @@ use crate::{
|
||||
Uuid, Variant,
|
||||
};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use crate::std::string::{String, ToString};
|
||||
|
||||
impl std::fmt::Debug for Uuid {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
@ -29,6 +32,13 @@ impl fmt::Display for Uuid {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl From<Uuid> for String {
|
||||
fn from(uuid: Uuid) -> Self {
|
||||
uuid.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Variant {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user