Skip to content

Commit

Permalink
Improve: AppDataResponse does not need a Clone trait bound
Browse files Browse the repository at this point in the history
- Fix: #703
  • Loading branch information
drmingdrmer committed Mar 9, 2023
1 parent af5002d commit 23f4a73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openraft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ impl<T> AppData for T where T: Clone + Send + Sync + 'static {}
///
/// The trait is automatically implemented for all types which satisfy its supertraits.
#[cfg(feature = "serde")]
pub trait AppDataResponse: Clone + Send + Sync + serde::Serialize + serde::de::DeserializeOwned + 'static {}
pub trait AppDataResponse: Send + Sync + serde::Serialize + serde::de::DeserializeOwned + 'static {}

#[cfg(feature = "serde")]
impl<T> AppDataResponse for T where T: Clone + Send + Sync + serde::Serialize + serde::de::DeserializeOwned + 'static {}
impl<T> AppDataResponse for T where T: Send + Sync + serde::Serialize + serde::de::DeserializeOwned + 'static {}

#[cfg(not(feature = "serde"))]
pub trait AppDataResponse: Clone + Send + Sync + 'static {}
pub trait AppDataResponse: Send + Sync + 'static {}

#[cfg(not(feature = "serde"))]
impl<T> AppDataResponse for T where T: Clone + Send + Sync + 'static {}
impl<T> AppDataResponse for T where T: Send + Sync + 'static {}

0 comments on commit 23f4a73

Please sign in to comment.