Skip to content

Commit

Permalink
WIP: Well-known types in prost-types needs to be generated again
Browse files Browse the repository at this point in the history
Open question: How is the `protobuf.rs` generated?
  • Loading branch information
caspermeijn committed Nov 24, 2023
1 parent f05a88b commit 2546fc8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion prost-types/src/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2292,7 +2292,7 @@ impl NullValue {
/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
/// the Joda Time's [`ISODateTimeFormat.dateTime()`](<http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D>) to obtain a formatter capable of generating timestamps in this format.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Timestamp {
/// Represents seconds of UTC time since Unix epoch
/// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
Expand Down
12 changes: 9 additions & 3 deletions tests/src/derive_copy.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
syntax = "proto3";

import "google/protobuf/timestamp.proto";

package derive_copy;

message EmptyMsg {}
Expand Down Expand Up @@ -39,7 +41,11 @@ message OneOfMsg {
}

message ComposedMsg {
IntegerMsg field1 = 1;
EnumMsg field2 = 2;
OneOfMsg field3 = 3;
IntegerMsg field1 = 1;
EnumMsg field2 = 2;
OneOfMsg field3 = 3;
}

message WellKnownMsg {
google.protobuf.Timestamp timestamp = 1;
}
2 changes: 2 additions & 0 deletions tests/src/derive_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ impl TestCopyIsImplemented for EnumMsg {}
impl TestCopyIsImplemented for OneOfMsg {}

impl TestCopyIsImplemented for ComposedMsg {}

impl TestCopyIsImplemented for WellKnownMsg {}

0 comments on commit 2546fc8

Please sign in to comment.