Skip to content

Commit

Permalink
Remove unused #[derive(..)] (#1483)
Browse files Browse the repository at this point in the history
This is a quick audit of unused derives; removing them makes it obvious
that types are not sent over the network or serialized.
  • Loading branch information
mkeeter authored Sep 30, 2024
1 parent eed6e87 commit 9e5cf42
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions upstairs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ mod cdt {
}

/// Array of data associated with three clients, indexed by `ClientId`
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema)]
#[serde(transparent)]
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
pub struct ClientData<T>([T; 3]);

impl<T> std::ops::Index<ClientId> for ClientData<T> {
Expand Down Expand Up @@ -439,8 +438,7 @@ impl<T> ClientData<T> {
}

/// Map of data associated with clients, keyed by `ClientId`
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema)]
#[serde(transparent)]
#[derive(Copy, Clone, Debug)]
pub struct ClientMap<T>(ClientData<Option<T>>);

impl<T> ClientMap<T> {
Expand Down Expand Up @@ -1369,7 +1367,7 @@ impl IOop {
}

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Debug, Clone, PartialEq)]
pub enum ReconcileIOState {
// A new IO request.
New,
Expand All @@ -1388,7 +1386,7 @@ pub enum ReconcileIOState {
* they operate independent of each other.
*/
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Debug, Clone, PartialEq)]
pub enum IOState {
/// The request has been sent to this tasks downstairs.
InProgress,
Expand Down

0 comments on commit 9e5cf42

Please sign in to comment.