Skip to content

Commit bd84ec9

Browse files
Optimize imports
1 parent f26367a commit bd84ec9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+256
-201
lines changed

src/api/auth.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
use crate::{path, responses};
1616

1717
use super::client::{Client, Result};
18+
use std::fmt::Display;
1819

1920
impl<E, U, P> Client<E, U, P>
2021
where
21-
E: std::fmt::Display,
22-
U: std::fmt::Display,
23-
P: std::fmt::Display,
22+
E: Display,
23+
U: Display,
24+
P: Display,
2425
{
2526
/// Returns the current OAuth 2.0 configuration for authentication.
2627
/// See [OAuth 2 Guide](https://www.rabbitmq.com/docs/oauth2) to learn more.

src/api/bindings.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ use crate::{
2323
use serde_json::{Map, Value, json};
2424

2525
use super::client::{Client, Result};
26+
use std::fmt::Display;
2627

2728
impl<E, U, P> Client<E, U, P>
2829
where
29-
E: std::fmt::Display,
30-
U: std::fmt::Display,
31-
P: std::fmt::Display,
30+
E: Display,
31+
U: Display,
32+
P: Display,
3233
{
3334
/// Lists all bindings (both queue-to-exchange and exchange-to-exchange ones) across the cluster.
3435
pub async fn list_bindings(&self) -> Result<Vec<responses::BindingInfo>> {

src/api/channels.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
use crate::{path, responses};
1616

1717
use super::client::{Client, Result};
18+
use std::fmt::Display;
1819

1920
impl<E, U, P> Client<E, U, P>
2021
where
21-
E: std::fmt::Display,
22-
U: std::fmt::Display,
23-
P: std::fmt::Display,
22+
E: Display,
23+
U: Display,
24+
P: Display,
2425
{
2526
/// Lists all channels across the cluster.
2627
/// See [Channels Guide](https://www.rabbitmq.com/docs/channels) to learn more.

src/api/client.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ use backtrace::Backtrace;
1919
use log::trace;
2020
use reqwest::{Client as HttpClient, StatusCode, header::HeaderMap};
2121
use serde::Serialize;
22-
use std::fmt;
22+
use serde::de::DeserializeOwned;
23+
use std::fmt::Display;
2324
use std::future::Future;
25+
use std::result;
2426
use std::time::Duration;
2527
use tokio::time::sleep;
2628

2729
pub type HttpClientResponse = reqwest::Response;
2830
pub type HttpClientError = crate::error::HttpClientError;
2931

30-
pub type Result<T> = std::result::Result<T, HttpClientError>;
32+
pub type Result<T> = result::Result<T, HttpClientError>;
3133

3234
/// A `ClientBuilder` can be used to create a `Client` with custom configuration.
3335
///
@@ -83,9 +85,9 @@ impl ClientBuilder {
8385

8486
impl<E, U, P> ClientBuilder<E, U, P>
8587
where
86-
E: fmt::Display,
87-
U: fmt::Display,
88-
P: fmt::Display,
88+
E: Display,
89+
U: Display,
90+
P: Display,
8991
{
9092
/// Sets the API credentials.
9193
pub fn with_basic_auth_credentials<NewU, NewP>(
@@ -94,8 +96,8 @@ where
9496
password: NewP,
9597
) -> ClientBuilder<E, NewU, NewP>
9698
where
97-
NewU: fmt::Display,
98-
NewP: fmt::Display,
99+
NewU: Display,
100+
NewP: Display,
99101
{
100102
ClientBuilder {
101103
endpoint: self.endpoint,
@@ -113,7 +115,7 @@ where
113115
/// Some examples: `http://localhost:15672/api` or `https://rabbitmq.example.com:15672/api`.
114116
pub fn with_endpoint<T>(self, endpoint: T) -> ClientBuilder<T, U, P>
115117
where
116-
T: fmt::Display,
118+
T: Display,
117119
{
118120
ClientBuilder {
119121
endpoint,
@@ -235,9 +237,9 @@ pub struct Client<E, U, P> {
235237

236238
impl<E, U, P> Client<E, U, P>
237239
where
238-
E: fmt::Display,
239-
U: fmt::Display,
240-
P: fmt::Display,
240+
E: Display,
241+
U: Display,
242+
P: Display,
241243
{
242244
/// Instantiates a client for the specified endpoint with username and password.
243245
///
@@ -368,7 +370,7 @@ where
368370

369371
pub(crate) async fn get_api_request<T, S>(&self, path: S) -> Result<T>
370372
where
371-
T: serde::de::DeserializeOwned,
373+
T: DeserializeOwned,
372374
S: AsRef<str>,
373375
{
374376
let response = self.http_get(path, None, None).await?;

src/api/cluster.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ use crate::{
1919
use serde_json::{Map, Value, json};
2020

2121
use super::client::{Client, Result};
22+
use std::fmt::Display;
2223

2324
impl<E, U, P> Client<E, U, P>
2425
where
25-
E: std::fmt::Display,
26-
U: std::fmt::Display,
27-
P: std::fmt::Display,
26+
E: Display,
27+
U: Display,
28+
P: Display,
2829
{
2930
/// Gets cluster name (identifier).
3031
pub async fn get_cluster_name(&self) -> Result<responses::ClusterIdentity> {

src/api/connections.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ use reqwest::{
1919
};
2020

2121
use super::client::{Client, Result};
22+
use std::fmt::Display;
2223

2324
impl<E, U, P> Client<E, U, P>
2425
where
25-
E: std::fmt::Display,
26-
U: std::fmt::Display,
27-
P: std::fmt::Display,
26+
E: Display,
27+
U: Display,
28+
P: Display,
2829
{
2930
/// Lists all AMQP 1.0 and 0-9-1 client connections across the cluster.
3031
/// See [Connections Guide](https://www.rabbitmq.com/docs/connections) to learn more.

src/api/consumers.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
use crate::{path, responses};
1616

1717
use super::client::{Client, Result};
18+
use std::fmt::Display;
1819

1920
impl<E, U, P> Client<E, U, P>
2021
where
21-
E: std::fmt::Display,
22-
U: std::fmt::Display,
23-
P: std::fmt::Display,
22+
E: Display,
23+
U: Display,
24+
P: Display,
2425
{
2526
/// Lists all stream publishers across the cluster.
2627
pub async fn list_stream_publishers(&self) -> Result<Vec<responses::StreamPublisher>> {

src/api/definitions.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ use crate::{
1919
use serde_json::Value;
2020

2121
use super::client::{Client, Result};
22+
use std::fmt::Display;
2223

2324
impl<E, U, P> Client<E, U, P>
2425
where
25-
E: std::fmt::Display,
26-
U: std::fmt::Display,
27-
P: std::fmt::Display,
26+
E: Display,
27+
U: Display,
28+
P: Display,
2829
{
2930
/// Exports cluster-wide definitions as a JSON document.
3031
/// This includes all virtual hosts, users, permissions, policies, queues, streams, exchanges, bindings, runtime parameters.

src/api/deprecations.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
use crate::responses::DeprecatedFeatureList;
1616

1717
use super::client::{Client, Result};
18+
use std::fmt::Display;
1819

1920
impl<E, U, P> Client<E, U, P>
2021
where
21-
E: std::fmt::Display,
22-
U: std::fmt::Display,
23-
P: std::fmt::Display,
22+
E: Display,
23+
U: Display,
24+
P: Display,
2425
{
2526
/// Lists all deprecated features.
2627
/// See [Deprecated Features](https://www.rabbitmq.com/docs/deprecated) to learn more.

src/api/exchanges.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
use crate::{path, requests::ExchangeParams, responses};
1616

1717
use super::client::{Client, Result};
18+
use std::fmt::Display;
1819

1920
impl<E, U, P> Client<E, U, P>
2021
where
21-
E: std::fmt::Display,
22-
U: std::fmt::Display,
23-
P: std::fmt::Display,
22+
E: Display,
23+
U: Display,
24+
P: Display,
2425
{
2526
/// Lists all exchanges across the cluster.
2627
/// See [Exchanges Guide](https://www.rabbitmq.com/docs/exchanges) to learn more.

0 commit comments

Comments
 (0)