You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, that API is intended to be consistent with the streams module API. I agree that having to (from the linked issue) would be a good idea, and to extend that I would love to see a generic read in the streams module as well. What I can do is of course add a generic read procedure. It won't mitigate the name pollution though.
stream.readExampleMessage
(as in https://github.com/PMunch/protobuf-nim/blob/master/README.rst) is not generic (eg can't be used in generic code), and also pollutes namespace with all the generated symbols.Instead of
stream.readExampleMessage
how about:option 1:
stream.toProto(ExampleMessage)
(preferred)option 2:
stream.toProto[ExampleMessage]
see https://github.com/nim-lang/Nim/issues/7430#issuecomment-377412261 for related discussion between option 1 vs option 2 (option 1 should be preferred)
NOTE: not sure if API generates other non-generic symbols such as
readExampleMessage
but same comment would applyThe text was updated successfully, but these errors were encountered: