Skip to content

Commit fee9e95

Browse files
authored
Remove ts-rs bug workaround since it was fixed in 10.1.0 (#714)
1 parent ae5af64 commit fee9e95

File tree

2 files changed

+12
-72
lines changed

2 files changed

+12
-72
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 11 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ define_modeling_cmd_enum! {
6262
)]
6363
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
6464
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
65-
pub struct StartPath {
66-
#[cfg(feature = "ts-rs")]
67-
/// Work around issue with ts-rs not allowing tag on an empty variant.
68-
#[serde(default, skip)]
69-
_fix_ts_rs: (),
70-
}
65+
pub struct StartPath {}
7166

7267
/// Move the path's "pen".
7368
/// If you're in sketch mode, these coordinates are in the local coordinate system,
@@ -275,12 +270,7 @@ define_modeling_cmd_enum! {
275270
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
276271
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
277272
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
278-
pub struct DefaultCameraGetSettings {
279-
#[cfg(feature = "ts-rs")]
280-
/// Work around issue with ts-rs not allowing tag on an empty variant.
281-
#[serde(default, skip)]
282-
_fix_ts_rs: (),
283-
}
273+
pub struct DefaultCameraGetSettings {}
284274

285275
/// Change what the default camera is looking at.
286276
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
@@ -562,12 +552,7 @@ define_modeling_cmd_enum! {
562552
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
563553
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
564554
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
565-
pub struct SceneClearAll {
566-
#[cfg(feature = "ts-rs")]
567-
/// Work around issue with ts-rs not allowing tag on an empty variant.
568-
#[serde(default, skip)]
569-
_fix_ts_rs: (),
570-
}
555+
pub struct SceneClearAll {}
571556

572557
/// Replaces current selection with these entities (by UUID).
573558
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
@@ -938,23 +923,13 @@ define_modeling_cmd_enum! {
938923
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
939924
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
940925
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
941-
pub struct SketchModeDisable {
942-
#[cfg(feature = "ts-rs")]
943-
/// Work around issue with ts-rs not allowing tag on an empty variant.
944-
#[serde(default, skip)]
945-
_fix_ts_rs: (),
946-
}
926+
pub struct SketchModeDisable {}
947927

948928
/// Get the plane for sketch mode.
949929
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
950930
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
951931
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
952-
pub struct GetSketchModePlane {
953-
#[cfg(feature = "ts-rs")]
954-
/// Work around issue with ts-rs not allowing tag on an empty variant.
955-
#[serde(default, skip)]
956-
_fix_ts_rs: (),
957-
}
932+
pub struct GetSketchModePlane {}
958933

959934
/// Get the plane for sketch mode.
960935
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
@@ -994,25 +969,15 @@ define_modeling_cmd_enum! {
994969
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
995970
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
996971
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
997-
pub struct EnableDryRun {
998-
#[cfg(feature = "ts-rs")]
999-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1000-
#[serde(default, skip)]
1001-
_fix_ts_rs: (),
1002-
}
972+
pub struct EnableDryRun {}
1003973

1004974
/// Sets whether or not changes to the scene or its objects will be done as a "dry run"
1005975
/// In a dry run, successful commands won't actually change the model.
1006976
/// This is useful for catching errors before actually making the change.
1007977
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1008978
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1009979
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1010-
pub struct DisableDryRun {
1011-
#[cfg(feature = "ts-rs")]
1012-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1013-
#[serde(default, skip)]
1014-
_fix_ts_rs: (),
1015-
}
980+
pub struct DisableDryRun {}
1016981

1017982
/// Set the background color of the scene.
1018983
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
@@ -1350,12 +1315,7 @@ define_modeling_cmd_enum! {
13501315
)]
13511316
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
13521317
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1353-
pub struct DefaultCameraSetOrthographic {
1354-
#[cfg(feature = "ts-rs")]
1355-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1356-
#[serde(default, skip)]
1357-
_fix_ts_rs: (),
1358-
}
1318+
pub struct DefaultCameraSetOrthographic {}
13591319

13601320
/// Use perspective projection.
13611321
#[derive(
@@ -1442,36 +1402,21 @@ define_modeling_cmd_enum! {
14421402
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
14431403
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
14441404
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1445-
pub struct SelectClear {
1446-
#[cfg(feature = "ts-rs")]
1447-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1448-
#[serde(default, skip)]
1449-
_fix_ts_rs: (),
1450-
}
1405+
pub struct SelectClear {}
14511406

14521407
/// Find all IDs of selected entities
14531408
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
14541409
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
14551410
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1456-
pub struct SelectGet {
1457-
#[cfg(feature = "ts-rs")]
1458-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1459-
#[serde(default, skip)]
1460-
_fix_ts_rs: (),
1461-
}
1411+
pub struct SelectGet {}
14621412

14631413
/// Get the number of objects in the scene
14641414
#[derive(
14651415
Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
14661416
)]
14671417
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
14681418
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1469-
pub struct GetNumObjects {
1470-
#[cfg(feature = "ts-rs")]
1471-
/// Work around issue with ts-rs not allowing tag on an empty variant.
1472-
#[serde(default, skip)]
1473-
_fix_ts_rs: (),
1474-
}
1419+
pub struct GetNumObjects {}
14751420

14761421
/// Make a new path by offsetting an object by a given distance.
14771422
/// The new path's ID will be the ID of this command.

modeling-cmds/src/shared.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,7 @@ pub struct AnnotationTextOptions {
141141
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
142142
pub enum DistanceType {
143143
/// Euclidean Distance.
144-
Euclidean {
145-
#[cfg(feature = "ts-rs")]
146-
/// Work around issue with ts-rs not allowing tag on an empty variant.
147-
#[serde(default, skip)]
148-
_fix_ts_rs: (),
149-
},
144+
Euclidean {},
150145
/// The distance between objects along the specified axis
151146
OnAxis {
152147
/// Global axis

0 commit comments

Comments
 (0)