Simplify string formatting of UUIDs
This commit is contained in:
parent
400ed09ecb
commit
3e25debd3a
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
use crate::sql::common::is_hex;
|
use crate::sql::common::is_hex;
|
||||||
use crate::sql::error::IResult;
|
use crate::sql::error::IResult;
|
||||||
|
use crate::sql::escape::escape_str;
|
||||||
use crate::sql::serde::is_internal_serialization;
|
use crate::sql::serde::is_internal_serialization;
|
||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::bytes::complete::take_while_m_n;
|
use nom::bytes::complete::take_while_m_n;
|
||||||
|
@ -8,7 +9,7 @@ use nom::combinator::recognize;
|
||||||
use nom::sequence::delimited;
|
use nom::sequence::delimited;
|
||||||
use nom::sequence::tuple;
|
use nom::sequence::tuple;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt;
|
use std::fmt::{self, Display, Formatter};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|
||||||
|
@ -43,9 +44,9 @@ impl Uuid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Uuid {
|
impl Display for Uuid {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
write!(f, "\"{}\"", self.0)
|
Display::fmt(&escape_str(&self.0.to_string()), f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue