Skip to content

Commit fa675f9

Browse files
authored
Bring angle units inline with length units (#934)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
1 parent 3e26f9e commit fa675f9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modeling-cmds/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kittycad-modeling-cmds"
3-
version = "0.2.133"
3+
version = "0.2.134"
44
edition = "2021"
55
authors = ["KittyCAD, Inc."]
66
description = "Commands in the KittyCAD Modeling API"

modeling-cmds/src/units.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ impl UnitLength {
7070

7171
/// The valid types of angle formats.
7272
#[derive(
73+
Default,
7374
Display,
7475
FromStr,
7576
Copy,
@@ -83,6 +84,7 @@ impl UnitLength {
8384
Ord,
8485
PartialOrd,
8586
UnitConversion,
87+
Hash,
8688
)]
8789
#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8890
#[serde(rename_all = "snake_case")]
@@ -92,8 +94,11 @@ impl UnitLength {
9294
#[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
9395
pub enum UnitAngle {
9496
/// Degrees <https://en.wikipedia.org/wiki/Degree_(angle)>
97+
#[default]
98+
#[display("deg")]
9599
Degrees,
96100
/// Radians <https://en.wikipedia.org/wiki/Radian>
101+
#[display("rad")]
97102
Radians,
98103
}
99104

0 commit comments

Comments
 (0)