Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
sjudd committed Oct 31, 2023
1 parent edc6ac5 commit 12bb8f2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,7 @@ impl Consul {
/// - payload: The [`DeregisterEntityPayload`](DeregisterEntityPayload) to provide the register entity API.
/// # Errors:
/// [ConsulError](consul::ConsulError) describes all possible errors returned by this api.
pub async fn deregister_entity(
&self,
payload: &DeregisterEntityPayload) -> Result<()> {
pub async fn deregister_entity(&self, payload: &DeregisterEntityPayload) -> Result<()> {
let uri = format!("{}/v1/catalog/deregister", self.config.address);
let request = hyper::Request::builder().method(Method::PUT).uri(uri);
let payload = serde_json::to_string(payload).map_err(ConsulError::InvalidRequest)?;
Expand Down Expand Up @@ -936,14 +934,15 @@ mod tests {
let node_id = "local";
register_entity(&consul, &new_service_name, node_id).await;

let payload = DeregisterEntityPayload {
Node: Some(node_id.to_string()),
Datacenter: None,
CheckID: None,
ServiceID: None,
Namespace: None,
let payload = DeregisterEntityPayload {
Node: Some(node_id.to_string()),
Datacenter: None,
CheckID: None,
ServiceID: None,
Namespace: None,
};
consul.deregister_entity(&payload)
consul
.deregister_entity(&payload)
.await
.expect("expected deregister_entity request to succeed");

Expand Down Expand Up @@ -1213,7 +1212,7 @@ mod tests {
assert_ne!(mod_idx3, mod_idx4);
}

async fn register_entity(consul: &Consul, service_name: &String, node_id: &str) {
async fn register_entity(consul: &Consul, service_name: &String, node_id: &str) {
let ResponseMeta {
response: service_names_before_register,
..
Expand Down

0 comments on commit 12bb8f2

Please sign in to comment.