From e86edf3d5ad1dd482ab00f49783fed9371bb69c9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:02:41 -0800 Subject: [PATCH] Fix rust comment rendering --- lib/xdrgen/generators/rust.rb | 2 +- .../block_comments.x/MyXDR.rs | 6 +- .../generator_spec_rust/enum.x/MyXDR.rs | 60 ++++++------ .../generator_spec_rust/nesting.x/MyXDR.rs | 48 +++++----- .../generator_spec_rust/optional.x/MyXDR.rs | 10 +- .../generator_spec_rust/struct.x/MyXDR.rs | 14 +-- .../generator_spec_rust/test.x/MyXDR.rs | 96 +++++++++---------- .../generator_spec_rust/union.x/MyXDR.rs | 36 +++---- .../block_comments.x/MyXDR.rs | 6 +- .../enum.x/MyXDR.rs | 60 ++++++------ .../nesting.x/MyXDR.rs | 48 +++++----- .../optional.x/MyXDR.rs | 10 +- .../struct.x/MyXDR.rs | 14 +-- .../test.x/MyXDR.rs | 96 +++++++++---------- .../union.x/MyXDR.rs | 36 +++---- 15 files changed, 271 insertions(+), 271 deletions(-) diff --git a/lib/xdrgen/generators/rust.rb b/lib/xdrgen/generators/rust.rb index 065de50f5..77309d57b 100644 --- a/lib/xdrgen/generators/rust.rb +++ b/lib/xdrgen/generators/rust.rb @@ -352,7 +352,7 @@ def render_source_comment(out, defn) /// EOS - out.puts "/// " + defn.text_value.split("\n").join("\n// ") + out.puts "/// " + defn.text_value.split("\n").join("\n/// ") out.puts <<-EOS.strip_heredoc /// diff --git a/spec/output/generator_spec_rust/block_comments.x/MyXDR.rs b/spec/output/generator_spec_rust/block_comments.x/MyXDR.rs index 11a17b3a5..f9c4c54a2 100644 --- a/spec/output/generator_spec_rust/block_comments.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/block_comments.x/MyXDR.rs @@ -2689,9 +2689,9 @@ mod test { /// AccountFlags is an XDR Enum defines as: /// /// enum AccountFlags -// { // masks for each flag -// AUTH_REQUIRED_FLAG = 0x1 -// }; +/// { // masks for each flag +/// AUTH_REQUIRED_FLAG = 0x1 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust/enum.x/MyXDR.rs b/spec/output/generator_spec_rust/enum.x/MyXDR.rs index bc9eaa136..9976ff927 100644 --- a/spec/output/generator_spec_rust/enum.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/enum.x/MyXDR.rs @@ -2689,28 +2689,28 @@ mod test { /// MessageType is an XDR Enum defines as: /// /// enum MessageType -// { -// ERROR_MSG, -// HELLO, -// DONT_HAVE, -// -// GET_PEERS, // gets a list of peers this guy knows about -// PEERS, -// -// GET_TX_SET, // gets a particular txset by hash -// TX_SET, -// -// GET_VALIDATIONS, // gets validations for a given ledger hash -// VALIDATIONS, -// -// TRANSACTION, //pass on a tx you have heard about -// JSON_TRANSACTION, -// -// // FBA -// GET_FBA_QUORUMSET, -// FBA_QUORUMSET, -// FBA_MESSAGE -// }; +/// { +/// ERROR_MSG, +/// HELLO, +/// DONT_HAVE, +/// +/// GET_PEERS, // gets a list of peers this guy knows about +/// PEERS, +/// +/// GET_TX_SET, // gets a particular txset by hash +/// TX_SET, +/// +/// GET_VALIDATIONS, // gets validations for a given ledger hash +/// VALIDATIONS, +/// +/// TRANSACTION, //pass on a tx you have heard about +/// JSON_TRANSACTION, +/// +/// // FBA +/// GET_FBA_QUORUMSET, +/// FBA_QUORUMSET, +/// FBA_MESSAGE +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2868,10 +2868,10 @@ Self::FbaMessage => "FbaMessage", /// Color is an XDR Enum defines as: /// /// enum Color { -// RED=0, -// GREEN=1, -// BLUE=2 -// }; +/// RED=0, +/// GREEN=1, +/// BLUE=2 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2974,10 +2974,10 @@ Self::Blue => "Blue", /// Color2 is an XDR Enum defines as: /// /// enum Color2 { -// RED2=RED, -// GREEN2=1, -// BLUE2=2 -// }; +/// RED2=RED, +/// GREEN2=1, +/// BLUE2=2 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust/nesting.x/MyXDR.rs b/spec/output/generator_spec_rust/nesting.x/MyXDR.rs index f069e3193..868367d5e 100644 --- a/spec/output/generator_spec_rust/nesting.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/nesting.x/MyXDR.rs @@ -2689,10 +2689,10 @@ mod test { /// UnionKey is an XDR Enum defines as: /// /// enum UnionKey { -// ONE = 1, -// TWO = 2, -// OFFER = 3 -// }; +/// ONE = 1, +/// TWO = 2, +/// OFFER = 3 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2801,8 +2801,8 @@ pub type Foo = i32; /// MyUnionOne is an XDR NestedStruct defines as: /// /// struct { -// int someInt; -// } +/// int someInt; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2835,9 +2835,9 @@ impl WriteXdr for MyUnionOne { /// MyUnionTwo is an XDR NestedStruct defines as: /// /// struct { -// int someInt; -// Foo foo; -// } +/// int someInt; +/// Foo foo; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2873,21 +2873,21 @@ self.foo.write_xdr(w)?; /// MyUnion is an XDR Union defines as: /// /// union MyUnion switch (UnionKey type) -// { -// case ONE: -// struct { -// int someInt; -// } one; -// -// case TWO: -// struct { -// int someInt; -// Foo foo; -// } two; -// -// case OFFER: -// void; -// }; +/// { +/// case ONE: +/// struct { +/// int someInt; +/// } one; +/// +/// case TWO: +/// struct { +/// int someInt; +/// Foo foo; +/// } two; +/// +/// case OFFER: +/// void; +/// }; /// // union with discriminant UnionKey #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust/optional.x/MyXDR.rs b/spec/output/generator_spec_rust/optional.x/MyXDR.rs index 8c108eb5c..37599abbb 100644 --- a/spec/output/generator_spec_rust/optional.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/optional.x/MyXDR.rs @@ -2695,11 +2695,11 @@ pub type Arr = [i32; 2]; /// HasOptions is an XDR Struct defines as: /// /// struct HasOptions -// { -// int* firstOption; -// int *secondOption; -// Arr *thirdOption; -// }; +/// { +/// int* firstOption; +/// int *secondOption; +/// Arr *thirdOption; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust/struct.x/MyXDR.rs b/spec/output/generator_spec_rust/struct.x/MyXDR.rs index 9971f02af..481c06e0d 100644 --- a/spec/output/generator_spec_rust/struct.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/struct.x/MyXDR.rs @@ -2695,13 +2695,13 @@ pub type Int64 = i64; /// MyStruct is an XDR Struct defines as: /// /// struct MyStruct -// { -// int someInt; -// int64 aBigInt; -// opaque someOpaque[10]; -// string someString<>; -// string maxString<100>; -// }; +/// { +/// int someInt; +/// int64 aBigInt; +/// opaque someOpaque[10]; +/// string someString<>; +/// string maxString<100>; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust/test.x/MyXDR.rs b/spec/output/generator_spec_rust/test.x/MyXDR.rs index a470902a7..1e31c5490 100644 --- a/spec/output/generator_spec_rust/test.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/test.x/MyXDR.rs @@ -3717,15 +3717,15 @@ pub type Int4 = u64; /// MyStruct is an XDR Struct defines as: /// /// struct MyStruct -// { -// uint512 field1; -// optHash1 field2; -// int1 field3; -// unsigned int field4; -// float field5; -// double field6; -// bool field7; -// }; +/// { +/// uint512 field1; +/// optHash1 field2; +/// int1 field3; +/// unsigned int field4; +/// float field5; +/// double field6; +/// bool field7; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3776,9 +3776,9 @@ self.field7.write_xdr(w)?; /// LotsOfMyStructs is an XDR Struct defines as: /// /// struct LotsOfMyStructs -// { -// MyStruct members<>; -// }; +/// { +/// MyStruct members<>; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3811,9 +3811,9 @@ impl WriteXdr for LotsOfMyStructs { /// HasStuff is an XDR Struct defines as: /// /// struct HasStuff -// { -// LotsOfMyStructs data; -// }; +/// { +/// LotsOfMyStructs data; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3846,10 +3846,10 @@ impl WriteXdr for HasStuff { /// Color is an XDR Enum defines as: /// /// enum Color { -// RED, -// BLUE = 5, -// GREEN -// }; +/// RED, +/// BLUE = 5, +/// GREEN +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -3964,9 +3964,9 @@ pub const BAR: u64 = FOO; /// NesterNestedEnum is an XDR NestedEnum defines as: /// /// enum { -// BLAH_1, -// BLAH_2 -// } +/// BLAH_1, +/// BLAH_2 +/// } /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -4064,8 +4064,8 @@ Self::2 => "2", /// NesterNestedStruct is an XDR NestedStruct defines as: /// /// struct { -// int blah; -// } +/// int blah; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -4098,11 +4098,11 @@ impl WriteXdr for NesterNestedStruct { /// NesterNestedUnion is an XDR NestedUnion defines as: /// /// union switch (Color color) { -// case RED: -// void; -// default: -// int blah2; -// } +/// case RED: +/// void; +/// default: +/// int blah2; +/// } /// // union with discriminant Color #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -4197,25 +4197,25 @@ impl WriteXdr for NesterNestedUnion { /// Nester is an XDR Struct defines as: /// /// struct Nester -// { -// enum { -// BLAH_1, -// BLAH_2 -// } nestedEnum; -// -// struct { -// int blah; -// } nestedStruct; -// -// union switch (Color color) { -// case RED: -// void; -// default: -// int blah2; -// } nestedUnion; -// -// -// }; +/// { +/// enum { +/// BLAH_1, +/// BLAH_2 +/// } nestedEnum; +/// +/// struct { +/// int blah; +/// } nestedStruct; +/// +/// union switch (Color color) { +/// case RED: +/// void; +/// default: +/// int blah2; +/// } nestedUnion; +/// +/// +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust/union.x/MyXDR.rs b/spec/output/generator_spec_rust/union.x/MyXDR.rs index 7583a8955..a2c4324a0 100644 --- a/spec/output/generator_spec_rust/union.x/MyXDR.rs +++ b/spec/output/generator_spec_rust/union.x/MyXDR.rs @@ -2701,9 +2701,9 @@ pub type Multi = i32; /// UnionKey is an XDR Enum defines as: /// /// enum UnionKey { -// ERROR, -// MULTI -// }; +/// ERROR, +/// MULTI +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2801,14 +2801,14 @@ Self::Multi => "Multi", /// MyUnion is an XDR Union defines as: /// /// union MyUnion switch (UnionKey type) -// { -// case ERROR: -// Error error; -// case MULTI: -// Multi things<>; -// -// -// }; +/// { +/// case ERROR: +/// Error error; +/// case MULTI: +/// Multi things<>; +/// +/// +/// }; /// // union with discriminant UnionKey #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2910,13 +2910,13 @@ Self::Multi(v) => v.write_xdr(w)?, /// IntUnion is an XDR Union defines as: /// /// union IntUnion switch (int type) -// { -// case 0: -// Error error; -// case 1: -// Multi things<>; -// -// }; +/// { +/// case 0: +/// Error error; +/// case 1: +/// Multi things<>; +/// +/// }; /// // union with discriminant i32 #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust_custom_str_impls/block_comments.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/block_comments.x/MyXDR.rs index 11a17b3a5..f9c4c54a2 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/block_comments.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/block_comments.x/MyXDR.rs @@ -2689,9 +2689,9 @@ mod test { /// AccountFlags is an XDR Enum defines as: /// /// enum AccountFlags -// { // masks for each flag -// AUTH_REQUIRED_FLAG = 0x1 -// }; +/// { // masks for each flag +/// AUTH_REQUIRED_FLAG = 0x1 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust_custom_str_impls/enum.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/enum.x/MyXDR.rs index bedd93801..4342e5471 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/enum.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/enum.x/MyXDR.rs @@ -2689,28 +2689,28 @@ mod test { /// MessageType is an XDR Enum defines as: /// /// enum MessageType -// { -// ERROR_MSG, -// HELLO, -// DONT_HAVE, -// -// GET_PEERS, // gets a list of peers this guy knows about -// PEERS, -// -// GET_TX_SET, // gets a particular txset by hash -// TX_SET, -// -// GET_VALIDATIONS, // gets validations for a given ledger hash -// VALIDATIONS, -// -// TRANSACTION, //pass on a tx you have heard about -// JSON_TRANSACTION, -// -// // FBA -// GET_FBA_QUORUMSET, -// FBA_QUORUMSET, -// FBA_MESSAGE -// }; +/// { +/// ERROR_MSG, +/// HELLO, +/// DONT_HAVE, +/// +/// GET_PEERS, // gets a list of peers this guy knows about +/// PEERS, +/// +/// GET_TX_SET, // gets a particular txset by hash +/// TX_SET, +/// +/// GET_VALIDATIONS, // gets validations for a given ledger hash +/// VALIDATIONS, +/// +/// TRANSACTION, //pass on a tx you have heard about +/// JSON_TRANSACTION, +/// +/// // FBA +/// GET_FBA_QUORUMSET, +/// FBA_QUORUMSET, +/// FBA_MESSAGE +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2868,10 +2868,10 @@ Self::FbaMessage => "FbaMessage", /// Color is an XDR Enum defines as: /// /// enum Color { -// RED=0, -// GREEN=1, -// BLUE=2 -// }; +/// RED=0, +/// GREEN=1, +/// BLUE=2 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2974,10 +2974,10 @@ Self::Blue => "Blue", /// Color2 is an XDR Enum defines as: /// /// enum Color2 { -// RED2=RED, -// GREEN2=1, -// BLUE2=2 -// }; +/// RED2=RED, +/// GREEN2=1, +/// BLUE2=2 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust_custom_str_impls/nesting.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/nesting.x/MyXDR.rs index ce4366d0f..328a96498 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/nesting.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/nesting.x/MyXDR.rs @@ -2689,10 +2689,10 @@ mod test { /// UnionKey is an XDR Enum defines as: /// /// enum UnionKey { -// ONE = 1, -// TWO = 2, -// OFFER = 3 -// }; +/// ONE = 1, +/// TWO = 2, +/// OFFER = 3 +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2801,8 +2801,8 @@ pub type Foo = i32; /// MyUnionOne is an XDR NestedStruct defines as: /// /// struct { -// int someInt; -// } +/// int someInt; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2835,9 +2835,9 @@ impl WriteXdr for MyUnionOne { /// MyUnionTwo is an XDR NestedStruct defines as: /// /// struct { -// int someInt; -// Foo foo; -// } +/// int someInt; +/// Foo foo; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2873,21 +2873,21 @@ self.foo.write_xdr(w)?; /// MyUnion is an XDR Union defines as: /// /// union MyUnion switch (UnionKey type) -// { -// case ONE: -// struct { -// int someInt; -// } one; -// -// case TWO: -// struct { -// int someInt; -// Foo foo; -// } two; -// -// case OFFER: -// void; -// }; +/// { +/// case ONE: +/// struct { +/// int someInt; +/// } one; +/// +/// case TWO: +/// struct { +/// int someInt; +/// Foo foo; +/// } two; +/// +/// case OFFER: +/// void; +/// }; /// // union with discriminant UnionKey #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/spec/output/generator_spec_rust_custom_str_impls/optional.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/optional.x/MyXDR.rs index 010a51f4b..5bd254b68 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/optional.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/optional.x/MyXDR.rs @@ -2695,11 +2695,11 @@ pub type Arr = [i32; 2]; /// HasOptions is an XDR Struct defines as: /// /// struct HasOptions -// { -// int* firstOption; -// int *secondOption; -// Arr *thirdOption; -// }; +/// { +/// int* firstOption; +/// int *secondOption; +/// Arr *thirdOption; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust_custom_str_impls/struct.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/struct.x/MyXDR.rs index 1419d031e..ddda1e12e 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/struct.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/struct.x/MyXDR.rs @@ -2695,13 +2695,13 @@ pub type Int64 = i64; /// MyStruct is an XDR Struct defines as: /// /// struct MyStruct -// { -// int someInt; -// int64 aBigInt; -// opaque someOpaque[10]; -// string someString<>; -// string maxString<100>; -// }; +/// { +/// int someInt; +/// int64 aBigInt; +/// opaque someOpaque[10]; +/// string someString<>; +/// string maxString<100>; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust_custom_str_impls/test.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/test.x/MyXDR.rs index 463bed842..4df3a5556 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/test.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/test.x/MyXDR.rs @@ -3717,15 +3717,15 @@ pub type Int4 = u64; /// MyStruct is an XDR Struct defines as: /// /// struct MyStruct -// { -// uint512 field1; -// optHash1 field2; -// int1 field3; -// unsigned int field4; -// float field5; -// double field6; -// bool field7; -// }; +/// { +/// uint512 field1; +/// optHash1 field2; +/// int1 field3; +/// unsigned int field4; +/// float field5; +/// double field6; +/// bool field7; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3776,9 +3776,9 @@ self.field7.write_xdr(w)?; /// LotsOfMyStructs is an XDR Struct defines as: /// /// struct LotsOfMyStructs -// { -// MyStruct members<>; -// }; +/// { +/// MyStruct members<>; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3811,9 +3811,9 @@ impl WriteXdr for LotsOfMyStructs { /// HasStuff is an XDR Struct defines as: /// /// struct HasStuff -// { -// LotsOfMyStructs data; -// }; +/// { +/// LotsOfMyStructs data; +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -3846,10 +3846,10 @@ impl WriteXdr for HasStuff { /// Color is an XDR Enum defines as: /// /// enum Color { -// RED, -// BLUE = 5, -// GREEN -// }; +/// RED, +/// BLUE = 5, +/// GREEN +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -3964,9 +3964,9 @@ pub const BAR: u64 = FOO; /// NesterNestedEnum is an XDR NestedEnum defines as: /// /// enum { -// BLAH_1, -// BLAH_2 -// } +/// BLAH_1, +/// BLAH_2 +/// } /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -4064,8 +4064,8 @@ Self::2 => "2", /// NesterNestedStruct is an XDR NestedStruct defines as: /// /// struct { -// int blah; -// } +/// int blah; +/// } /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -4098,11 +4098,11 @@ impl WriteXdr for NesterNestedStruct { /// NesterNestedUnion is an XDR NestedUnion defines as: /// /// union switch (Color color) { -// case RED: -// void; -// default: -// int blah2; -// } +/// case RED: +/// void; +/// default: +/// int blah2; +/// } /// // union with discriminant Color #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -4197,25 +4197,25 @@ impl WriteXdr for NesterNestedUnion { /// Nester is an XDR Struct defines as: /// /// struct Nester -// { -// enum { -// BLAH_1, -// BLAH_2 -// } nestedEnum; -// -// struct { -// int blah; -// } nestedStruct; -// -// union switch (Color color) { -// case RED: -// void; -// default: -// int blah2; -// } nestedUnion; -// -// -// }; +/// { +/// enum { +/// BLAH_1, +/// BLAH_2 +/// } nestedEnum; +/// +/// struct { +/// int blah; +/// } nestedStruct; +/// +/// union switch (Color color) { +/// case RED: +/// void; +/// default: +/// int blah2; +/// } nestedUnion; +/// +/// +/// }; /// #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/spec/output/generator_spec_rust_custom_str_impls/union.x/MyXDR.rs b/spec/output/generator_spec_rust_custom_str_impls/union.x/MyXDR.rs index f4e17814b..525d43a32 100644 --- a/spec/output/generator_spec_rust_custom_str_impls/union.x/MyXDR.rs +++ b/spec/output/generator_spec_rust_custom_str_impls/union.x/MyXDR.rs @@ -2701,9 +2701,9 @@ pub type Multi = i32; /// UnionKey is an XDR Enum defines as: /// /// enum UnionKey { -// ERROR, -// MULTI -// }; +/// ERROR, +/// MULTI +/// }; /// // enum #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2801,14 +2801,14 @@ Self::Multi => "Multi", /// MyUnion is an XDR Union defines as: /// /// union MyUnion switch (UnionKey type) -// { -// case ERROR: -// Error error; -// case MULTI: -// Multi things<>; -// -// -// }; +/// { +/// case ERROR: +/// Error error; +/// case MULTI: +/// Multi things<>; +/// +/// +/// }; /// // union with discriminant UnionKey #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] @@ -2910,13 +2910,13 @@ Self::Multi(v) => v.write_xdr(w)?, /// IntUnion is an XDR Union defines as: /// /// union IntUnion switch (int type) -// { -// case 0: -// Error error; -// case 1: -// Multi things<>; -// -// }; +/// { +/// case 0: +/// Error error; +/// case 1: +/// Multi things<>; +/// +/// }; /// // union with discriminant i32 #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]