Concordium / concordium-contracts-common

Common functionality used by smart contracts and the host environment on the Concordium blockchain.
Mozilla Public License 2.0
10 stars 10 forks source link

Update syn to version 2 for derive crate #98

Closed limemloh closed 1 year ago

limemloh commented 1 year ago

Purpose

A new version of the syn crate has been released with better support for the Rust syntax and a number of helpers that we would want. This PR updates the dependency and migrates our code. Not changes for the user.

Should be merged with https://github.com/Concordium/concordium-base/pull/402

abizjak commented 1 year ago

I'm not really sure what problem this is solving so that it's important to have to do it now. The code looks roughly equal in terms of complexity to me.

It also makes it so that two versions of syn will now be required in rust-sdk since concordium-base still has V1 so we'd want to update it there as well.

limemloh commented 1 year ago

We could work around this for now, but with the new version attributes are typed closer to what people use it for. In our case the value of Meta::NameValue is now an expression and I would like to use array expressions for the next feature that I am working on. Another advantage is that we can start using libraries such as darling.

abizjak commented 1 year ago

We could work around this for now, but with the new version attributes are typed closer to what people use it for. In our case the value of Meta::NameValue is now an expression and I would like to use array expressions for the next feature that I am working on. Another advantage is that we can start using libraries such as darling.

Ok. I'm not so sure about darling. It's a pretty complex dependency and moving our stuff to using it is going to increase compilation times, and probably introduce bugs. I don't think that much will be gained by it.