Commit 5829c9c2 authored by Éloïs's avatar Éloïs

[style] apply fmt and fix clippy warnings

parent 223c1b78
use crate::*;
use dubp_documents::v10::certification::*;
use dubp_documents::v10::identity::*;
use dubp_documents::v10::membership::*;
......@@ -13,7 +14,6 @@ use durs_network_documents::network_peer::*;
use durs_network_documents::*;
use std::ops::Deref;
use wasm_bindgen::prelude::*;
use crate::*;
#[wasm_bindgen]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
......@@ -112,10 +112,10 @@ pub fn parse_doc_into_json(doc: &str, doc_type: DocumentType) -> String {
V10Document::to_json_string_pretty(&V10Document::Transaction(Box::new(
tx_v10,
)))
.unwrap_or("Fail to jsonifie document.".to_owned())
.unwrap_or_else(|_| "Fail to jsonifie document.".to_owned())
} else {
V10Document::to_json_string_pretty(&doc_v10)
.unwrap_or("Fail to jsonifie document.".to_owned())
.unwrap_or_else(|_| "Fail to jsonifie document.".to_owned())
}
}
_ => unimplemented!(),
......@@ -123,12 +123,12 @@ pub fn parse_doc_into_json(doc: &str, doc_type: DocumentType) -> String {
Document_::NetworkDocument(network_document) => match network_document {
NetworkDocument::Peer(peer_box) => match peer_box.deref() {
PeerCard::V11(peer_v11) => PeerCardV11::to_json_string_pretty(&peer_v11)
.unwrap_or("Fail to jsonifie document.".to_owned()),
.unwrap_or_else(|_| "Fail to jsonifie document.".to_owned()),
_ => unimplemented!(),
},
NetworkDocument::Head(head) => match head {
NetworkHead::V3(head_v3) => NetworkHeadV3::to_json_string_pretty(&head_v3)
.unwrap_or("Fail to jsonifie document.".to_owned()),
.unwrap_or_else(|_| "Fail to jsonifie document.".to_owned()),
_ => unimplemented!(),
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment