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

Fix the path for google/protobuf/empty.proto in pbtest #152

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pb-test/gen/pb-jelly/proto_google/src/lib.rs.expected
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
#[macro_use]
extern crate lazy_static;

pub mod empty;
pub mod protobuf;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @generated, do not edit

pub mod empty;
20 changes: 10 additions & 10 deletions pb-test/gen/pb-jelly/proto_pbtest/src/pbtest2.rs.expected
Original file line number Diff line number Diff line change
Expand Up @@ -4000,7 +4000,7 @@ impl ::pb_jelly::Message for TestMessage {
size += bool6_size;
let mut a_size = 0;
if let TestMessage_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
let l = ::pb_jelly::Message::compute_size(val);
a_size += ::pb_jelly::wire_format::serialized_length(70);
a_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand All @@ -4009,7 +4009,7 @@ impl ::pb_jelly::Message for TestMessage {
size += a_size;
let mut b_size = 0;
if let TestMessage_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
let l = ::pb_jelly::Message::compute_size(val);
b_size += ::pb_jelly::wire_format::serialized_length(71);
b_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand Down Expand Up @@ -4189,11 +4189,11 @@ impl ::pb_jelly::Message for TestMessage {
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage_OneofEmptyField::C(ref val) = self.oneof_empty_field {
Expand Down Expand Up @@ -4424,14 +4424,14 @@ impl ::pb_jelly::Message for TestMessage {
::pb_jelly::Message::serialize(val, w)?;
}
if let TestMessage_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
::pb_jelly::wire_format::write(70, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
::pb_jelly::Message::serialize(val, w)?;
}
if let TestMessage_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
::pb_jelly::wire_format::write(71, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
Expand Down Expand Up @@ -4934,15 +4934,15 @@ impl ::pb_jelly::Message for TestMessage {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "TestMessage", 70)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
oneof_oneof_empty_field = Some(TestMessage_OneofEmptyField::A);
}
71 => {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "TestMessage", 71)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
oneof_oneof_empty_field = Some(TestMessage_OneofEmptyField::B);
}
Expand Down Expand Up @@ -5041,11 +5041,11 @@ impl ::pb_jelly::Reflection for TestMessage {
}
"oneof_empty_field" => {
if let TestMessage_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
return Some("a");
}
if let TestMessage_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
return Some("b");
}
if let TestMessage_OneofEmptyField::C(ref val) = self.oneof_empty_field {
Expand Down
46 changes: 23 additions & 23 deletions pb-test/gen/pb-jelly/proto_pbtest/src/pbtest3.rs.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3682,7 +3682,7 @@ impl ::pb_jelly::Message for TestMessage3 {
size += bool6_size;
let mut a_size = 0;
if let TestMessage3_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
let l = ::pb_jelly::Message::compute_size(val);
a_size += ::pb_jelly::wire_format::serialized_length(70);
a_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand All @@ -3691,7 +3691,7 @@ impl ::pb_jelly::Message for TestMessage3 {
size += a_size;
let mut b_size = 0;
if let TestMessage3_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
let l = ::pb_jelly::Message::compute_size(val);
b_size += ::pb_jelly::wire_format::serialized_length(71);
b_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand Down Expand Up @@ -3933,11 +3933,11 @@ impl ::pb_jelly::Message for TestMessage3 {
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage3_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage3_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let TestMessage3_OneofEmptyField::C(ref val) = self.oneof_empty_field {
Expand Down Expand Up @@ -4307,14 +4307,14 @@ impl ::pb_jelly::Message for TestMessage3 {
::pb_jelly::Message::serialize(val, w)?;
}
if let TestMessage3_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
::pb_jelly::wire_format::write(70, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
::pb_jelly::Message::serialize(val, w)?;
}
if let TestMessage3_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
::pb_jelly::wire_format::write(71, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
Expand Down Expand Up @@ -4874,15 +4874,15 @@ impl ::pb_jelly::Message for TestMessage3 {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "TestMessage3", 70)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
oneof_oneof_empty_field = Some(TestMessage3_OneofEmptyField::A);
}
71 => {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "TestMessage3", 71)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
oneof_oneof_empty_field = Some(TestMessage3_OneofEmptyField::B);
}
Expand Down Expand Up @@ -5019,11 +5019,11 @@ impl ::pb_jelly::Reflection for TestMessage3 {
}
"oneof_empty_field" => {
if let TestMessage3_OneofEmptyField::A = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
return Some("a");
}
if let TestMessage3_OneofEmptyField::B = self.oneof_empty_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
return Some("b");
}
if let TestMessage3_OneofEmptyField::C(ref val) = self.oneof_empty_field {
Expand Down Expand Up @@ -6226,7 +6226,7 @@ impl ::pb_jelly::Reflection for TestMessage3ErrIfDefaultEnum {

#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TestMessage3ErrIfDefaultEnumOneof {
pub nothing: ::std::option::Option<::proto_google::empty::Empty>,
pub nothing: ::std::option::Option<::proto_google::protobuf::empty::Empty>,
pub maybe: ::std::option::Option<TestMessage3ErrIfDefaultEnumOneof_Maybe>,
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
Expand Down Expand Up @@ -6331,7 +6331,7 @@ impl ::pb_jelly::Message for TestMessage3ErrIfDefaultEnumOneof {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "TestMessage3ErrIfDefaultEnumOneof", 2)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
self.nothing = Some(val);
}
Expand Down Expand Up @@ -9043,7 +9043,7 @@ pub struct RecursiveOneof {
pub enum RecursiveOneof_OneofField {
Field(::std::boxed::Box<RecursiveOneof>),
Empty,
BoxedEmpty(::std::boxed::Box<::proto_google::empty::Empty>),
BoxedEmpty(::std::boxed::Box<::proto_google::protobuf::empty::Empty>),
NotBoxed(ForeignMessage3),
Boxed(::std::boxed::Box<ForeignMessage3>),
}
Expand Down Expand Up @@ -9129,7 +9129,7 @@ impl ::pb_jelly::Message for RecursiveOneof {
size += field_size;
let mut empty_size = 0;
if let Some(RecursiveOneof_OneofField::Empty) = self.oneof_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
let l = ::pb_jelly::Message::compute_size(val);
empty_size += ::pb_jelly::wire_format::serialized_length(2);
empty_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand All @@ -9138,7 +9138,7 @@ impl ::pb_jelly::Message for RecursiveOneof {
size += empty_size;
let mut boxed_empty_size = 0;
if let Some(RecursiveOneof_OneofField::BoxedEmpty(ref val)) = self.oneof_field {
let val: &::proto_google::empty::Empty = &**val;
let val: &::proto_google::protobuf::empty::Empty = &**val;
let l = ::pb_jelly::Message::compute_size(val);
boxed_empty_size += ::pb_jelly::wire_format::serialized_length(3);
boxed_empty_size += ::pb_jelly::varint::serialized_length(l as u64);
Expand Down Expand Up @@ -9171,11 +9171,11 @@ impl ::pb_jelly::Message for RecursiveOneof {
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let Some(RecursiveOneof_OneofField::Empty) = self.oneof_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let Some(RecursiveOneof_OneofField::BoxedEmpty(ref val)) = self.oneof_field {
let val: &::proto_google::empty::Empty = &**val;
let val: &::proto_google::protobuf::empty::Empty = &**val;
size += ::pb_jelly::Message::compute_grpc_slices_size(val);
}
if let Some(RecursiveOneof_OneofField::NotBoxed(ref val)) = self.oneof_field {
Expand All @@ -9196,14 +9196,14 @@ impl ::pb_jelly::Message for RecursiveOneof {
::pb_jelly::Message::serialize(val, w)?;
}
if let Some(RecursiveOneof_OneofField::Empty) = self.oneof_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
::pb_jelly::Message::serialize(val, w)?;
}
if let Some(RecursiveOneof_OneofField::BoxedEmpty(ref val)) = self.oneof_field {
let val: &::proto_google::empty::Empty = &**val;
let val: &::proto_google::protobuf::empty::Empty = &**val;
::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?;
let l = ::pb_jelly::Message::compute_size(val);
::pb_jelly::varint::write(l as u64, w)?;
Expand Down Expand Up @@ -9239,15 +9239,15 @@ impl ::pb_jelly::Message for RecursiveOneof {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "RecursiveOneof", 2)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
self.oneof_field = Some(RecursiveOneof_OneofField::Empty);
}
3 => {
::pb_jelly::ensure_wire_format(typ, ::pb_jelly::wire_format::Type::LengthDelimited, "RecursiveOneof", 3)?;
let len = ::pb_jelly::varint::ensure_read(&mut buf)?;
let mut next = ::pb_jelly::ensure_split(buf, len as usize)?;
let mut val: ::proto_google::empty::Empty = ::std::default::Default::default();
let mut val: ::proto_google::protobuf::empty::Empty = ::std::default::Default::default();
::pb_jelly::Message::deserialize(&mut val, &mut next)?;
self.oneof_field = Some(RecursiveOneof_OneofField::BoxedEmpty(Box::new(val)));
}
Expand Down Expand Up @@ -9284,11 +9284,11 @@ impl ::pb_jelly::Reflection for RecursiveOneof {
return Some("field");
}
if let Some(RecursiveOneof_OneofField::Empty) = self.oneof_field {
let val: &::proto_google::empty::Empty = &::std::default::Default::default();
let val: &::proto_google::protobuf::empty::Empty = &::std::default::Default::default();
return Some("empty");
}
if let Some(RecursiveOneof_OneofField::BoxedEmpty(ref val)) = self.oneof_field {
let val: &::proto_google::empty::Empty = &**val;
let val: &::proto_google::protobuf::empty::Empty = &**val;
return Some("boxed_empty");
}
if let Some(RecursiveOneof_OneofField::NotBoxed(ref val)) = self.oneof_field {
Expand Down
2 changes: 1 addition & 1 deletion pb-test/proto/packages/pbtest/pbtest2.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax="proto2";

import "google/empty.proto";
import "google/protobuf/empty.proto";
import "rust/extensions.proto";

package pbtest;
Expand Down
2 changes: 1 addition & 1 deletion pb-test/proto/packages/pbtest/pbtest3.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax="proto3";

import "google/empty.proto";
import "google/protobuf/empty.proto";
import "pbtest/pbtest2.proto";
import "rust/extensions.proto";

Expand Down
2 changes: 1 addition & 1 deletion pb-test/src/verify_generated_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn verify_generated_files() {

// Assert the correct number of pb-test generated files
// Developers - please change this number if the change is intentional
assert_eq!(proto_files.len(), 12);
assert_eq!(proto_files.len(), 13);

// Assert contents of the generated files
for proto_file in proto_files {
Expand Down
Loading