Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generator panics when bytes::Bytes are enabled #362

Closed
ancwrd1 opened this issue Dec 24, 2018 · 1 comment
Closed

Code generator panics when bytes::Bytes are enabled #362

ancwrd1 opened this issue Dec 24, 2018 · 1 comment

Comments

@ancwrd1
Copy link

ancwrd1 commented Dec 24, 2018

Using the following code generation snippet (from build.rs):

protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
        out_dir: &out_dir.to_string_lossy(),
        input: &slices,
        includes: &[&proto_dir.to_string_lossy()],
        customize: protobuf_codegen_pure::Customize {
            carllerche_bytes_for_bytes: Some(true),
            ..Default::default()
        },
    })
    .expect("protoc");

Cargo.toml contains under [dependencies] section:
protobuf = { version = "2.2", features = ["with-bytes"] }

This code panics with:

thread 'main' panicked at 'unexpected field type: ::bytes::Bytes', /home/build/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-codegen-2.2.0/src/field.rs:858

Is there anything missing?

@stepancheg
Copy link
Owner

oneof with bytes was not implemented. Fixed and published v2.2.1. Thank you for the bugreport!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants