11use futures:: AsyncBufRead ;
2- use serde:: { de:: DeserializeOwned , Serialize } ;
2+ use serde:: { Serialize , de:: DeserializeOwned } ;
33use std:: fmt:: Debug ;
44
55use crate :: {
6- api:: { Api , Patch , PatchParams , PostParams } ,
76 Error , Result ,
7+ api:: { Api , Patch , PatchParams , PostParams } ,
88} ;
99
1010use kube_core:: response:: Status ;
@@ -16,8 +16,10 @@ pub use kube_core::subresource::AttachParams;
1616
1717pub use k8s_openapi:: api:: autoscaling:: v1:: { Scale , ScaleSpec , ScaleStatus } ;
1818
19- #[ cfg( feature = "ws" ) ] use crate :: api:: portforward:: Portforwarder ;
20- #[ cfg( feature = "ws" ) ] use crate :: api:: remote_command:: AttachedProcess ;
19+ #[ cfg( feature = "ws" ) ]
20+ use crate :: api:: portforward:: Portforwarder ;
21+ #[ cfg( feature = "ws" ) ]
22+ use crate :: api:: remote_command:: AttachedProcess ;
2123
2224/// Methods for [scale subresource](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#scale-subresource).
2325impl < K > Api < K >
@@ -399,13 +401,12 @@ k8s_openapi::k8s_if_ge_1_33! {
399401 /// let mut pod = pods.get("mypod").await?;
400402 ///
401403 /// // Modify resource requirements
402- /// if let Some(spec) = &mut pod.spec {
403- /// if let Some(container) = spec.containers.get_mut(0) {
404- /// if let Some(resources) = &mut container.resources {
405- /// // Update CPU/memory limits or requests
406- /// // ...
407- /// }
408- /// }
404+ /// if let Some(spec) = &mut pod.spec
405+ /// && let Some(container) = spec.containers.get_mut(0)
406+ /// && let Some(resources) = &mut container.resources
407+ /// {
408+ /// // Update CPU/memory limits or requests
409+ /// // ...
409410 /// }
410411 ///
411412 /// pods.replace_resize("mypod", &pp, &pod).await?;
0 commit comments