capnproto-rust
capnproto-rust copied to clipboard
bespoke traits that could be replaced with standard traits
i see some bespoke traits which are similar to standard library traits, I was hoping you could comment.
For example, there are ToU16 and FromU16 traits, which seem like they would map precisely to the standard library traits Into<u16> and TryFrom<u16, Error=capnp::NotInSchema> respectively. Is there a reason for not using the standard traits?
- [x] #336
- [ ] #337
- [ ] #340
- [ ] #355
- [ ] #349
- [x] #350
- [ ] #351
incidentally, if i were to change the code generation for files like capnpc/src/schema_capnp.rs, how would I regenerate those files?
Using the standard Into and TryFrom traits makes sense to me. Probably ToU16 and FromU16 were created before the standard traits existed. Note, though, that replacing them would be a breaking change. So I suppose that's another thing that can go into the 0.16.0 release, whenever we do that.
incidentally, if i were to change the code generation for files like capnpc/src/schema_capnp.rs, how would I regenerate those files?
- Get the the corresponding
.capnpfiles from the main capnproto repo: https://github.com/capnproto/capnproto/blob/master/c%2B%2B/src/capnp/schema.capnp - build
capnpc-rustwithcargo build -p capnpc --release - run
capnp compile -o./target/release/capnpc-rust [schema file]
starting to collect a few breaking changes. how do you keep track? will you just leave this PR open?
starting to collect a few breaking changes. how do you keep track? will you just leave the PR open?
We could add a "version bump" label for issues and PRs.
@dwrensha I notice there's a huge number of structs with new_default constructors. Is there a reason for using this pattern over the built in Default trait?