stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
118 stars 66 forks source link

Fix Hash<> not cloneable #1302

Closed leighmcculloch closed 1 month ago

leighmcculloch commented 1 month 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 1 month ago

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

leighmcculloch commented 1 month ago

Released in 21.4.0.