quininer / cbor4ii

CBOR: Concise Binary Object Representation
MIT License
54 stars 5 forks source link

serde: use scopeguard dependency #20

Closed vmx closed 2 years ago

vmx commented 2 years ago

Instead of having a custom scope guard implementation use the established scopeguard crate.

I made this change to my Serde implementation and I thought I upstream it. I'm a fan of having less code to maintain. scopeguard itself doesn't have any further dependencies so the overall build time/code size should stay similar. Though I can also understand if you prefer keeping your dependencies to a minimum.

quininer commented 2 years ago

It's very small and I don't think it's code that needs to be maintained by someone. I'd rather avoid an unnecessary dependency. In addition, scopeguard crate also introduces a lot of unsafe code.

vmx commented 2 years ago

I also missed that it's used in core, which complicates things a bit. Thanks for pointing out the usage if unsafe in scopeguard, that's a good point. I'm closing this PR.