chore: do not namespace as proto

This commit is contained in:
zaaarf 2024-03-09 19:27:29 +01:00
parent 4347dfa9d7
commit 460ef34712
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B

View file

@ -1,6 +1,5 @@
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub mod proto { pub mod common {
pub mod common {
tonic::include_proto!("common"); tonic::include_proto!("common");
impl From<uuid::Uuid> for Identity { impl From<uuid::Uuid> for Identity {
@ -8,27 +7,9 @@ pub mod proto {
Identity { id: id.to_string() } Identity { id: id.to_string() }
} }
} }
}
impl From<&uuid::Uuid> for Identity { pub mod files {
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 {
tonic::include_proto!("files"); tonic::include_proto!("files");
impl From<String> for BufferNode { impl From<String> for BufferNode {
@ -50,18 +31,17 @@ pub mod proto {
value.path value.path
} }
} }
} }
pub mod buffer { pub mod buffer {
tonic::include_proto!("buffer"); tonic::include_proto!("buffer");
} }
pub mod cursor { pub mod cursor {
tonic::include_proto!("cursor"); tonic::include_proto!("cursor");
} }
pub mod workspace { pub mod workspace {
tonic::include_proto!("workspace"); tonic::include_proto!("workspace");
} }
pub mod auth { pub mod auth {
tonic::include_proto!("auth"); tonic::include_proto!("auth");
}
} }