Skip to content

Commit

Permalink
chore: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Oct 1, 2023
1 parent 8f7a3f0 commit 0a81018
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tools/shuttle/src/document.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::collections::BTreeMap;

use libipld::{DagCbor, Cid};
use serde::{Serialize, Deserialize};


use libipld::{Cid, DagCbor};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, DagCbor)]
pub struct IdentityRoot {
identities: BTreeMap<String, Cid>,
prev_block: Option<Cid>,
package: BTreeMap<String, Cid>,
}

#[derive(Serialize, Deserialize, DagCbor)]
pub struct FriendRouterRoot {}
16 changes: 11 additions & 5 deletions tools/shuttle/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,15 @@ impl Behaviour {
}
protocol::SynchronizedResponse::Error(e) => {
let e = match e {
protocol::SynchronizedError::DoesntExist => warp::error::Error::IdentityDoesntExist,
protocol::SynchronizedError::Forbidden => warp::error::Error::IdentityInvalid,
protocol::SynchronizedError::NotRegistered => warp::error::Error::IdentityNotCreated,
protocol::SynchronizedError::DoesntExist => {
warp::error::Error::IdentityDoesntExist
}
protocol::SynchronizedError::Forbidden => {
warp::error::Error::IdentityInvalid
}
protocol::SynchronizedError::NotRegistered => {
warp::error::Error::IdentityNotCreated
}
protocol::SynchronizedError::Invalid => warp::error::Error::IdentityInvalid,
};
match self.waiting_on_response.remove(&id) {
Expand All @@ -344,7 +350,7 @@ impl Behaviour {
}
_ => {}
};
},
}
},
_ => {}
}
Expand Down Expand Up @@ -487,7 +493,7 @@ impl NetworkBehaviour for Behaviour {
},
Poll::Ready(None) => {
//There is no point in keeping a stream if it already closed, though we should probably panic here
//but there may be cases where the rest of the behaviour should be proceeding
//but there may be cases where the rest of the behaviour should be proceeding
self.process_command.take();
break;
}
Expand Down

0 comments on commit 0a81018

Please sign in to comment.