Remove useless as_str on ID
This commit is contained in:
parent
b2176fe6b0
commit
327f59e2a9
|
@ -33,7 +33,7 @@ pub trait Type {
|
||||||
|
|
||||||
/// Returns a `GlobalID` that is unique among all types.
|
/// Returns a `GlobalID` that is unique among all types.
|
||||||
fn global_id(id: ID) -> ID {
|
fn global_id(id: ID) -> ID {
|
||||||
base64::encode(format!("{}:{}", Self::type_name(), id.as_str())).into()
|
base64::encode(format!("{}:{}", Self::type_name(), *id)).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse `GlobalID`.
|
/// Parse `GlobalID`.
|
||||||
|
|
|
@ -12,13 +12,6 @@ use uuid::Uuid;
|
||||||
#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
|
#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
|
||||||
pub struct ID(String);
|
pub struct ID(String);
|
||||||
|
|
||||||
impl ID {
|
|
||||||
/// Gives a string representation of the ID
|
|
||||||
pub fn as_str(&self) -> &str {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Deref for ID {
|
impl Deref for ID {
|
||||||
type Target = String;
|
type Target = String;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user