Skip to content

Commit 6784a00

Browse files
committed
Replace .clone_from_slice with .copy_from_slice
1 parent 57aaf8c commit 6784a00

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/crypto/src/bls12_318/aggregate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn bls12_381_aggregate_g1(points: &[u8]) -> Result<[u8; 48], CryptoError> {
2828
.chunks_exact(G1_POINT_SIZE)
2929
.map(|data| {
3030
let mut buf = [0u8; 48];
31-
buf[..].clone_from_slice(data);
31+
buf[..].copy_from_slice(data);
3232
buf
3333
})
3434
.collect();
@@ -70,7 +70,7 @@ pub fn bls12_381_aggregate_g2(points: &[u8]) -> Result<[u8; 96], CryptoError> {
7070
.chunks_exact(G2_POINT_SIZE)
7171
.map(|data| {
7272
let mut buf = [0u8; 96];
73-
buf[..].clone_from_slice(data);
73+
buf[..].copy_from_slice(data);
7474
buf
7575
})
7676
.collect();

packages/crypto/src/bls12_318/points.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn g1_from_variable(data: &[u8]) -> Result<G1, CryptoError> {
125125
}
126126

127127
let mut buf = [0u8; BLS12_381_G1_POINT_LEN];
128-
buf[..].clone_from_slice(data);
128+
buf[..].copy_from_slice(data);
129129
g1_from_fixed(&buf)
130130
}
131131

@@ -149,7 +149,7 @@ pub fn g2_from_variable(data: &[u8]) -> Result<G2, CryptoError> {
149149
}
150150

151151
let mut buf = [0u8; BLS12_381_G2_POINT_LEN];
152-
buf[..].clone_from_slice(data);
152+
buf[..].copy_from_slice(data);
153153
g2_from_fixed(&buf)
154154
}
155155

0 commit comments

Comments
 (0)