Skip to content

Commit

Permalink
chore(sequencer_infra): remove redundant clones
Browse files Browse the repository at this point in the history
commit-id:8a20078e
  • Loading branch information
Itay-Tsabary-Starkware committed Nov 17, 2024
1 parent 6f3696a commit d06d399
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::serde_utils::BincodeSerdeWrapper;
/// };
///
/// // Define your request and response types
/// #[derive(Serialize, Deserialize, Debug, Clone)]
/// #[derive(Serialize, Deserialize, Debug)]
/// struct MyRequest {
/// pub content: String,
/// }
Expand Down Expand Up @@ -134,7 +134,6 @@ where
}
}

// TODO(Tsabary): remove clone trait from request and response, throughout.
#[async_trait]
impl<Request, Response> ComponentClient<Request, Response>
for RemoteComponentClient<Request, Response>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use crate::errors::{ComponentServerError, ReplaceComponentError};
/// #[async_trait]
/// impl ComponentRequestHandler<MyRequest, MyResponse> for MyComponent {
/// async fn handle_request(&mut self, request: MyRequest) -> MyResponse {
/// MyResponse { content: request.content.clone() + " processed" }
/// MyResponse { content: request.content + " processed" }
/// }
/// }
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ use crate::serde_utils::BincodeSerdeWrapper;
/// #[async_trait]
/// impl ComponentRequestHandler<MyRequest, MyResponse> for MyComponent {
/// async fn handle_request(&mut self, request: MyRequest) -> MyResponse {
/// MyResponse { content: request.content.clone() + " processed" }
/// MyResponse { content: request.content + " processed" }
/// }
/// }
///
Expand Down
8 changes: 4 additions & 4 deletions crates/starknet_sequencer_infra/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ pub(crate) type ValueB = Felt;
pub(crate) type ResultA = ClientResult<ValueA>;
pub(crate) type ResultB = ClientResult<ValueB>;

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentARequest {
AGetValue,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentAResponse {
AGetValue(ValueA),
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentBRequest {
BGetValue,
BSetValue(ValueB),
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug)]
pub enum ComponentBResponse {
BGetValue(ValueB),
BSetValue,
Expand Down

0 comments on commit d06d399

Please sign in to comment.