Skip to content

Commit 32ef011

Browse files
authored
Made PreparedStatement drop tracing ids on clone (#512)
As cloning a vector of tracing ids is redundant and conflicts with the general rule that cloning should be cheap, we drop it. Co-authored-by: Wojciech Przytuła <[email protected]>
1 parent 5a9ac43 commit 32ef011

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

scylla/src/statement/prepared_statement.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::transport::partitioner::PartitionerName;
1212
use crate::transport::retry_policy::RetryPolicy;
1313

1414
/// Represents a statement prepared on the server.
15-
#[derive(Clone)]
1615
pub struct PreparedStatement {
1716
pub(crate) config: StatementConfig,
1817
pub prepare_tracing_ids: Vec<Uuid>,
@@ -24,6 +23,20 @@ pub struct PreparedStatement {
2423
partitioner_name: PartitionerName,
2524
}
2625

26+
impl Clone for PreparedStatement {
27+
fn clone(&self) -> Self {
28+
Self {
29+
config: self.config.clone(),
30+
prepare_tracing_ids: Vec::new(),
31+
id: self.id.clone(),
32+
metadata: self.metadata.clone(),
33+
statement: self.statement.clone(),
34+
page_size: self.page_size,
35+
partitioner_name: self.partitioner_name.clone(),
36+
}
37+
}
38+
}
39+
2740
impl PreparedStatement {
2841
pub(crate) fn new(
2942
id: Bytes,

0 commit comments

Comments
 (0)