mirror of
https://github.com/hexedtech/codemp-proto.git
synced 2024-11-25 08:54: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
52
src/lib.rs
52
src/lib.rs
|
@ -1,6 +1,5 @@
|
|||
#[allow(non_snake_case)]
|
||||
pub mod proto {
|
||||
pub mod common {
|
||||
pub mod common {
|
||||
tonic::include_proto!("common");
|
||||
|
||||
impl From<uuid::Uuid> for Identity {
|
||||
|
@ -8,27 +7,9 @@ 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 {
|
||||
pub mod files {
|
||||
tonic::include_proto!("files");
|
||||
|
||||
impl From<String> for BufferNode {
|
||||
|
@ -50,18 +31,17 @@ pub mod proto {
|
|||
value.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod buffer {
|
||||
tonic::include_proto!("buffer");
|
||||
}
|
||||
pub mod cursor {
|
||||
tonic::include_proto!("cursor");
|
||||
}
|
||||
pub mod workspace {
|
||||
tonic::include_proto!("workspace");
|
||||
}
|
||||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
}
|
||||
|
||||
pub mod buffer {
|
||||
tonic::include_proto!("buffer");
|
||||
}
|
||||
pub mod cursor {
|
||||
tonic::include_proto!("cursor");
|
||||
}
|
||||
pub mod workspace {
|
||||
tonic::include_proto!("workspace");
|
||||
}
|
||||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue