stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
128 stars 67 forks source link

Fix Hash<> not cloneable #1302

Closed leighmcculloch closed 4 months ago

leighmcculloch commented 4 months ago

What

Implement Clone for the Hash<> type introduced in v21.

Why

The BytesN<> type implements Clone, and the Hash<> type was added to replace BytesN<> in certain situations. It is harder to upgrade code in the wild that was written using BytesN<> because Hash<> isn't cloneable.

Hash<> can be cloned, there's no reason to keep it.

The type is also marked as transparent same as BytesN<> in this change.

leighmcculloch commented 4 months ago

I plan to release the SDK crate with a patch release once this fix is merged.

leighmcculloch commented 4 months ago

Released in 21.4.0.