-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply clippy::clone_on_copy
throughout stacks core
#5764
Conversation
Signed-off-by: Jacinta Ferrant <[email protected]>
… into chore/clippy-clone-on-copy
I think I would prefer deleting the |
@kantai I assume you're referring mostly to 32 byte hash/key types, right? Do we want to establish an upper size limit for what types are allowed to implement |
Yeah -- I think something along this kind of patch at least: diff --git a/stacks-common/src/util/macros.rs b/stacks-common/src/util/macros.rs
index 4e332179e6..5a3a873410 100644
--- a/stacks-common/src/util/macros.rs
+++ b/stacks-common/src/util/macros.rs
@@ -414,8 +414,6 @@ macro_rules! impl_array_newtype {
}
}
- impl Copy for $thing {}
-
impl ::std::hash::Hash for $thing {
#[inline]
fn hash<H>(&self, state: &mut H)
diff --git a/stacks-common/src/util/secp256k1.rs b/stacks-common/src/util/secp256k1.rs
index e569a8ba0d..ca60a622fe 100644
--- a/stacks-common/src/util/secp256k1.rs
+++ b/stacks-common/src/util/secp256k1.rs
@@ -35,7 +35,7 @@ use crate::util::hash::{hex_bytes, to_hex};
// per-thread Secp256k1 context
thread_local!(static _secp256k1: Secp256k1<secp256k1::All> = Secp256k1::new());
-#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Hash)]
+#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Hash)]
pub struct Secp256k1PublicKey {
// serde is broken for secp256k1, so do it ourselves
#[serde(
@@ -46,7 +46,7 @@ pub struct Secp256k1PublicKey {
compressed: bool,
}
-#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
+#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
pub struct Secp256k1PrivateKey {
// serde is broken for secp256k1, so do it ourselves
#[serde( I am little hesitant to establish an upper size limit: for my part, I kind of think |
|
I would agree with @kantai here. I would default to only have |
From the call: Consensus is to get rid of |
Gonna close and replace. |
No description provided.