tweedegolf / sequential-storage

A crate for storing data in flash memory with minimal need for erasing pages
Apache License 2.0
87 stars 8 forks source link

store_item should take StorageItem by reference #21

Closed t-moe closed 6 months ago

t-moe commented 6 months ago

store_item takes the StorageItem by value, even though it is only passed by reference to StorageItem::serialize_into.

Is this an oversight or is there a bigger idea behind this?

(my StorageItem is rather big and expensiv to Clone. I would prefer to be able to continue using it, after storing it)

diondokter commented 6 months ago

Oh, there's no idea behind it. Wouldn't call it an oversight though, it just never came up as a problem.

We could change it. Seems fair. Are you willing to make a PR? If you do, also include it as a breaking change in the changelog.

Since it's a breaking change, I probably don't want to release it until #19 is ready.