quicktype-core 23.0.61 → 23.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,7 @@ export declare const rustOptions: {
19
19
  visibility: EnumOption<Visibility>;
20
20
  deriveDebug: BooleanOption;
21
21
  deriveClone: BooleanOption;
22
+ derivePartialEq: BooleanOption;
22
23
  edition2018: BooleanOption;
23
24
  leadingComments: BooleanOption;
24
25
  };
@@ -34,6 +34,7 @@ exports.rustOptions = {
34
34
  ]),
35
35
  deriveDebug: new RendererOptions_1.BooleanOption("derive-debug", "Derive Debug impl", false),
36
36
  deriveClone: new RendererOptions_1.BooleanOption("derive-clone", "Derive Clone impl", false),
37
+ derivePartialEq: new RendererOptions_1.BooleanOption("derive-partial-eq", "Derive PartialEq impl", false),
37
38
  edition2018: new RendererOptions_1.BooleanOption("edition-2018", "Edition 2018", true),
38
39
  leadingComments: new RendererOptions_1.BooleanOption("leading-comments", "Leading Comments", true)
39
40
  };
@@ -94,6 +95,7 @@ class RustTargetLanguage extends TargetLanguage_1.TargetLanguage {
94
95
  exports.rustOptions.visibility,
95
96
  exports.rustOptions.deriveDebug,
96
97
  exports.rustOptions.deriveClone,
98
+ exports.rustOptions.derivePartialEq,
97
99
  exports.rustOptions.edition2018,
98
100
  exports.rustOptions.leadingComments
99
101
  ];
@@ -275,7 +277,7 @@ class RustRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
275
277
  }
276
278
  emitStructDefinition(c, className) {
277
279
  this.emitDescription(this.descriptionForType(c));
278
- this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", "Serialize, Deserialize)]");
280
+ this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", this._options.derivePartialEq ? "PartialEq, " : "", "Serialize, Deserialize)]");
279
281
  // List the possible naming styles for every class property
280
282
  const propertiesNamingStyles = {};
281
283
  this.forEachClassProperty(c, "none", (_name, jsonName, _prop) => {
@@ -306,7 +308,7 @@ class RustRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
306
308
  return;
307
309
  }
308
310
  this.emitDescription(this.descriptionForType(u));
309
- this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", "Serialize, Deserialize)]");
311
+ this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", this._options.derivePartialEq ? "PartialEq, " : "", "Serialize, Deserialize)]");
310
312
  this.emitLine("#[serde(untagged)]");
311
313
  const [, nonNulls] = (0, TypeUtils_1.removeNullFromUnion)(u);
312
314
  const blankLines = this._options.density === Density.Dense ? "none" : "interposing";
@@ -317,7 +319,7 @@ class RustRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
317
319
  }
318
320
  emitEnumDefinition(e, enumName) {
319
321
  this.emitDescription(this.descriptionForType(e));
320
- this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", "Serialize, Deserialize)]");
322
+ this.emitLine("#[derive(", this._options.deriveDebug ? "Debug, " : "", this._options.deriveClone ? "Clone, " : "", this._options.derivePartialEq ? "PartialEq, " : "", "Serialize, Deserialize)]");
321
323
  // List the possible naming styles for every enum case
322
324
  const enumCasesNamingStyles = {};
323
325
  this.forEachEnumCase(e, "none", (_name, jsonName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "23.0.61",
3
+ "version": "23.0.62",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",