rustfmt
This commit is contained in:
parent
3c67388fae
commit
4f8d6ec3d0
16 changed files with 61 additions and 60 deletions
|
@ -1,9 +1,8 @@
|
|||
use reqwest::Method;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::UbisyncRequest;
|
||||
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct AppRegisterRequest {
|
||||
pub name: String,
|
||||
|
@ -25,4 +24,4 @@ impl UbisyncRequest for AppRegisterRequest {
|
|||
fn path(&self, _: Self::PathParameters) -> String {
|
||||
"/app/register".to_string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
use reqwest::Method;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::types::{ElementContent, ElementId, Element};
|
||||
use crate::types::{Element, ElementContent, ElementId};
|
||||
|
||||
use super::UbisyncRequest;
|
||||
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ElementCreateRequest {
|
||||
pub content: ElementContent,
|
||||
|
@ -28,7 +27,6 @@ impl UbisyncRequest for ElementCreateRequest {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ElementGetRequest;
|
||||
|
||||
|
@ -78,11 +76,11 @@ pub struct ElementRemoveResponse;
|
|||
impl UbisyncRequest for ElementRemoveRequest {
|
||||
type PathParameters = ElementId;
|
||||
type Response = ElementRemoveResponse;
|
||||
|
||||
|
||||
fn method(&self) -> Method {
|
||||
Method::DELETE
|
||||
}
|
||||
fn path(&self, params: Self::PathParameters) -> String {
|
||||
format!("/element/{}", serde_json::to_string(¶ms).unwrap())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ pub mod messages;
|
|||
pub mod peer;
|
||||
pub mod types;
|
||||
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! tracing_setup {
|
||||
($level:expr) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::types::{MessageId, ElementId, ElementContent};
|
||||
use crate::types::{ElementContent, ElementId, MessageId};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct Message {
|
||||
|
@ -9,8 +9,6 @@ pub struct Message {
|
|||
content: MessageContent,
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct MessageRelations {
|
||||
pub parents: Vec<MessageId>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue