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

Automatically derive tuple_struct attr and trivial From impls where possible #2772

Merged
merged 10 commits into from
Jul 21, 2023
2 changes: 1 addition & 1 deletion crates/re_space_view_spatial/src/parts/points2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Points2DPart {
(point, Some(label)) => Some(UiLabel {
text: label,
color: *color,
target: UiLabelTarget::Point2D(egui::pos2(point.xy.x, point.xy.y)),
target: UiLabelTarget::Point2D(egui::pos2(point.x(), point.y())),
labeled_instance: *labeled_instance,
}),
_ => None,
Expand Down
1 change: 0 additions & 1 deletion crates/re_types/definitions/rerun/components/class_id.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct ClassId (
"attr.python.array_aliases": "int, npt.NDArray[np.uint8], npt.NDArray[np.uint16], npt.NDArray[np.uint32], npt.NDArray[np.uint64]",
"attr.rerun.legacy_fqname": "rerun.class_id",
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash",
"attr.rust.tuple_struct",
order: 100
) {
id: ushort (order: 100);
Expand Down
1 change: 0 additions & 1 deletion crates/re_types/definitions/rerun/components/color.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ struct Color (
"attr.rerun.legacy_fqname": "rerun.colorrgba",
"attr.rust.derive": "Default, Copy, PartialEq, Eq, PartialOrd, Ord, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
order: 100
) {
rgba: uint (order: 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ struct DrawOrder (
"attr.rerun.legacy_fqname": "rerun.draw_order",
"attr.rust.derive": "Copy",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
order: 100
) {
value: float (order: 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct InstanceKey (
"attr.python.aliases": "int",
"attr.python.array_aliases": "int, npt.NDArray[np.uint64]",
"attr.rerun.legacy_fqname": "rerun.instance_key",
"attr.rust.tuple_struct",
"attr.rust.derive": "Copy, Hash, PartialEq, Eq, PartialOrd, Ord",
order: 100
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct KeypointId (
"attr.python.array_aliases": "float, npt.NDArray[np.uint8], npt.NDArray[np.uint16], npt.NDArray[np.uint32]",
"attr.rerun.legacy_fqname": "rerun.keypoint_id",
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash",
"attr.rust.tuple_struct",
order: 200
) {
id: ushort (order: 100);
Expand Down
1 change: 0 additions & 1 deletion crates/re_types/definitions/rerun/components/label.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ table Label (
"attr.rerun.legacy_fqname": "rerun.label",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
order: 100
) {
value: string (order: 100);
Expand Down
1 change: 0 additions & 1 deletion crates/re_types/definitions/rerun/components/point2d.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace rerun.components;
// ---

/// A point in 2D space.
// TODO(cmc): bring back attr.rust.tuple_struct
struct Point2D (
"attr.python.aliases": "npt.NDArray[np.float32], Sequence[float], Tuple[float, float]",
"attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[float]",
Expand Down
1 change: 0 additions & 1 deletion crates/re_types/definitions/rerun/components/radius.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct Radius (
"attr.python.aliases": "float",
"attr.python.array_aliases": "float, npt.NDArray[np.float32]",
"attr.rerun.legacy_fqname": "rerun.radius",
"attr.rust.tuple_struct",
"attr.rust.derive": "Copy, PartialEq, PartialOrd",
order: 100
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ table Transform3D (
// wrong schema for this component.
//"attr.rerun.legacy_fqname": "rerun.transform3d",
"attr.rust.derive": "PartialEq",
"attr.rust.tuple_struct",
order: 100
) {
/// Representation of the transform.
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script.
# It can be safely removed at anytime to force the build script to run again.
# Check out build.rs to see how it's computed.
4e7bff9578be94c0d8e42808d39c49e58b03a4b6dd5dd571dbf87ed7640fcca4
b4f2c2b3b6518fd5c5b8fe2255952c6986895efe58cbc6ae0b56b0384a9ad930
Loading