Skip to content

buffa_build produce an error when it should not #12

@Guiguiprim

Description

@Guiguiprim

the following valid proto file produce a build error

syntax = "proto3";

package minimal;

message StringFieldMatcher {
    enum MatchOperator {
        MATCH_OPERATOR_UNKNOWN = 0;
        MATCH_OPERATOR_EXACT_MATCH = 1;
    }
    optional MatchOperator match_operator = 4;
}

the error:

  called `Result::unwrap()` on an `Err` value: NestedTypeOneofConflict { scope: "minimal.StringFieldMatcher", nested_name: "MatchOperator", oneof_name: "_match_operator", rust_name: "MatchOperator" }

renaming match_operator to match_operator_field fix the error.

But I see no conflict in the generated code and think the first one should build.

used build.rs:

fn main() {
    buffa_build::Config::new()
        .files(&["proto/minimal.proto"])
        .includes(&["proto/"])
        .compile()
        .unwrap();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions