diff --git a/examples/pod_attach.rs b/examples/pod_attach.rs index d4eba2ca3..c3cf64cc1 100644 --- a/examples/pod_attach.rs +++ b/examples/pod_attach.rs @@ -1,5 +1,4 @@ -#[macro_use] -extern crate log; +#[macro_use] extern crate log; use std::io::Write; diff --git a/examples/pod_exec.rs b/examples/pod_exec.rs index 6aa233bd8..787ec3006 100644 --- a/examples/pod_exec.rs +++ b/examples/pod_exec.rs @@ -1,5 +1,4 @@ -#[macro_use] -extern crate log; +#[macro_use] extern crate log; use futures::{StreamExt, TryStreamExt}; use k8s_openapi::api::core::v1::Pod; diff --git a/examples/pod_shell.rs b/examples/pod_shell.rs index dc63d3a4e..c8f8c46aa 100644 --- a/examples/pod_shell.rs +++ b/examples/pod_shell.rs @@ -1,5 +1,4 @@ -#[macro_use] -extern crate log; +#[macro_use] extern crate log; use futures::{StreamExt, TryStreamExt}; use k8s_openapi::api::core::v1::Pod; diff --git a/kube/src/api/mod.rs b/kube/src/api/mod.rs index c9d94abc4..36fb73d99 100644 --- a/kube/src/api/mod.rs +++ b/kube/src/api/mod.rs @@ -20,10 +20,8 @@ pub use typed::Api; mod dynamic; pub use dynamic::DynamicResource; -#[cfg(feature = "ws")] -mod remote_command; -#[cfg(feature = "ws")] -pub use remote_command::AttachedProcess; +#[cfg(feature = "ws")] mod remote_command; +#[cfg(feature = "ws")] pub use remote_command::AttachedProcess; mod subresource; #[cfg(feature = "ws")] diff --git a/kube/src/api/remote_command.rs b/kube/src/api/remote_command.rs index 2e2e2e1a8..bdfc74a4a 100644 --- a/kube/src/api/remote_command.rs +++ b/kube/src/api/remote_command.rs @@ -1,8 +1,7 @@ use std::{ future::Future, pin::Pin, - sync::Arc, - sync::Mutex, + sync::{Arc, Mutex}, task::{Context, Poll, Waker}, }; diff --git a/kube/src/api/subresource.rs b/kube/src/api/subresource.rs index d8c22bccd..0e0aa63ee 100644 --- a/kube/src/api/subresource.rs +++ b/kube/src/api/subresource.rs @@ -9,8 +9,7 @@ use crate::{ pub use k8s_openapi::api::autoscaling::v1::{Scale, ScaleSpec, ScaleStatus}; -#[cfg(feature = "ws")] -use crate::api::remote_command::AttachedProcess; +#[cfg(feature = "ws")] use crate::api::remote_command::AttachedProcess; /// Methods for [scale subresource](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#scale-subresource). impl Api diff --git a/kube/src/client/mod.rs b/kube/src/client/mod.rs index 6595969e4..c894ea400 100644 --- a/kube/src/client/mod.rs +++ b/kube/src/client/mod.rs @@ -13,10 +13,8 @@ use crate::{ Error, Result, }; -#[cfg(feature = "ws")] -mod ws; -#[cfg(feature = "ws")] -use ws::AsyncTlsConnector; +#[cfg(feature = "ws")] mod ws; +#[cfg(feature = "ws")] use ws::AsyncTlsConnector; #[cfg(feature = "ws")] use async_tungstenite::{ @@ -441,6 +439,7 @@ impl TryFrom for Client { impl TryFrom for reqwest::ClientBuilder { type Error = Error; + fn try_from(config: Config) -> Result { let mut builder = Self::new(); diff --git a/kube/src/client/ws.rs b/kube/src/client/ws.rs index 4e1a31e29..47f93f775 100644 --- a/kube/src/client/ws.rs +++ b/kube/src/client/ws.rs @@ -12,6 +12,7 @@ mod tls { impl TryFrom for AsyncTlsConnector { type Error = Error; + fn try_from(config: Config) -> Result { let mut builder = TlsConnector::builder(); if let Some((identity, identity_password)) = config.identity.as_ref() { @@ -38,8 +39,7 @@ mod tls { #[cfg(feature = "ws-rustls-tls")] mod tls { - use std::convert::TryFrom; - use std::sync::Arc; + use std::{convert::TryFrom, sync::Arc}; use tokio_rustls::rustls::{self, Certificate, ClientConfig}; pub use tokio_rustls::TlsConnector as AsyncTlsConnector; @@ -48,6 +48,7 @@ mod tls { impl TryFrom for AsyncTlsConnector { type Error = Error; + fn try_from(config: Config) -> Result { use rustls::internal::pemfile; use std::io::Cursor; diff --git a/kube/src/config/file_loader.rs b/kube/src/config/file_loader.rs index 897dfe46b..64b9fb0b9 100644 --- a/kube/src/config/file_loader.rs +++ b/kube/src/config/file_loader.rs @@ -8,8 +8,7 @@ use super::{ }; use crate::{error::ConfigError, Result}; -#[cfg(feature = "rustls-tls")] -use crate::Error; +#[cfg(feature = "rustls-tls")] use crate::Error; /// KubeConfigOptions stores options used when loading kubeconfig file. #[derive(Default, Clone)]