Skip to content

Commit

Permalink
refactor: be a bit more explicit on response type
Browse files Browse the repository at this point in the history
  • Loading branch information
tuneerroy committed Dec 12, 2023
1 parent 091168d commit fb5a922
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/broker_lead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,26 @@ impl BrokerLead {
.and_modify(|count| *count += 1)
.or_insert(1);
}
eprintln!("Partitions created.");
} else {
eprintln!("Partitions already exists.");
}

// print partitions
for (topic, partitions) in topic_to_partitions.iter() {
eprintln!("Topic: {}", topic);
for partition in partitions {
eprintln!(" Partition: {}", partition.partition_id);
}
}

topic_to_producer_count
.entry(topic.clone())
.and_modify(|count| *count += 1)
.or_insert(1);

warp::reply::json(&topic_to_partitions[&topic].clone())
let reply: Vec<PartitionInfo> = topic_to_partitions[&topic].clone();
warp::reply::json(&reply);
}
});

Expand Down

0 comments on commit fb5a922

Please sign in to comment.