mirror of
https://github.com/hexedtech/codemp-proto.git
synced 2024-11-22 07:24:50 +01:00
chore: do not namespace as proto
This commit is contained in:
parent
4347dfa9d7
commit
460ef34712
1 changed files with 42 additions and 62 deletions
20
src/lib.rs
20
src/lib.rs
|
@ -1,5 +1,4 @@
|
|||
#[allow(non_snake_case)]
|
||||
pub mod proto {
|
||||
pub mod common {
|
||||
tonic::include_proto!("common");
|
||||
|
||||
|
@ -8,24 +7,6 @@ pub mod proto {
|
|||
Identity { id: id.to_string() }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uuid::Uuid> for Identity {
|
||||
fn from(id: &uuid::Uuid) -> Self {
|
||||
Identity { id: id.to_string() }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Identity> for uuid::Uuid {
|
||||
fn from(value: Identity) -> Self {
|
||||
uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity")
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Identity> for uuid::Uuid {
|
||||
fn from(value: &Identity) -> Self {
|
||||
uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod files {
|
||||
|
@ -64,4 +45,3 @@ pub mod proto {
|
|||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue