-
The traits TryInto<> for FiledValue is implemented on value, not on reference. That means that value (of type FieldValue) must be consumed during conversion. I think it is not quite convenient. One more inconvenience arises from the fact that the method get of FieldTable returns a borrowed reference to FieldValue. Of course implementing this trait for reference means that this cloning will take place inside of the try_into() method. Is such a change possible? Desirable? Will it break some existing code? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
TryInto trait contract is to consume the type, for type safety, cannot use reference |
Beta Was this translation helpful? Give feedback.
TryInto trait contract is to consume the type, for type safety, cannot use reference
get is not supposed to return reference, user need to clone it explictly, which is better than implicitly doing clone at cost internally