Skip to content

Commit

Permalink
Suppress dead code warnings reported by nightly rustc in clientset re…
Browse files Browse the repository at this point in the history
…sponse enums.

Although these fields are not used by the code directly, they are printed by
the Debug impl when a test panics because the response is unexpected.
  • Loading branch information
Arnavion committed Jan 17, 2024
1 parent 5edc0ee commit 7103d72
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
pub(crate) enum CreateResponse<T> where T: serde::de::DeserializeOwned {
Ok(T),
Created(T),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for CreateResponse<T> where T: serde::de::DeserializeOwned {
Expand Down
4 changes: 2 additions & 2 deletions k8s-openapi-tests/src/clientset/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ where

#[derive(Debug)]
pub(crate) enum DeleteResponse<T> where T: serde::de::DeserializeOwned {
OkStatus(k8s_openapi::apimachinery::pkg::apis::meta::v1::Status),
OkStatus(#[allow(dead_code)] k8s_openapi::apimachinery::pkg::apis::meta::v1::Status),
OkValue(T),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for DeleteResponse<T> where T: serde::de::DeserializeOwned {
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ where
#[derive(Debug)]
pub(crate) enum ListResponse<T> where T: serde::de::DeserializeOwned + k8s_openapi::ListableResource {
Ok(k8s_openapi::List<T>),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for ListResponse<T> where T: serde::de::DeserializeOwned + k8s_openapi::ListableResource {
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub(crate) fn get_api_versions() -> (http::Request<Vec<u8>>, fn(reqwest::StatusC
#[derive(Debug)]
pub(crate) enum GetAPIVersionsResponse {
Ok(k8s_openapi::apimachinery::pkg::apis::meta::v1::APIGroupList),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl Response for GetAPIVersionsResponse {
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ where
#[derive(Debug)]
pub(crate) enum PatchResponse<T> where T: serde::de::DeserializeOwned {
Ok(T),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for PatchResponse<T> where T: serde::de::DeserializeOwned {
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
#[derive(Debug)]
pub(crate) enum ReadResponse<T> where T: serde::de::DeserializeOwned {
Ok(T),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for ReadResponse<T> where T: serde::de::DeserializeOwned {
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/src/clientset/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl<'a> WatchOptional<'a> {
#[derive(Debug)]
pub(crate) enum WatchResponse<T> where T: serde::de::DeserializeOwned {
Ok(k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent<T>),
Other(Result<Option<serde_json::Value>, serde_json::Error>),
Other(#[allow(dead_code)] Result<Option<serde_json::Value>, serde_json::Error>),
}

impl<T> super::Response for WatchResponse<T> where T: serde::de::DeserializeOwned {
Expand Down

0 comments on commit 7103d72

Please sign in to comment.