diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-02 15:45:01 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-02 15:45:01 +0100 |
| commit | 45abcf6b2bc247c8c0cba79eb1b0bc36a5d1df43 (patch) | |
| tree | 3dc454557219d08176d14af052a1c8c68ea82ec0 /src/geom/angle.rs | |
| parent | 36adbe4b80e57613244adb87301c81c0a23f67f7 (diff) | |
Remove dependencies on itoa and ryu ⬇️
Diffstat (limited to 'src/geom/angle.rs')
| -rw-r--r-- | src/geom/angle.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/geom/angle.rs b/src/geom/angle.rs index 07471a02..2392efa5 100644 --- a/src/geom/angle.rs +++ b/src/geom/angle.rs @@ -58,14 +58,13 @@ impl Display for Angle { fn fmt(&self, f: &mut Formatter) -> fmt::Result { // Format with the unit that yields the shortest output, preferring // degrees when tied. - let mut buf = ryu::Buffer::new(); let unit = [AngularUnit::Deg, AngularUnit::Rad] .iter() .copied() - .min_by_key(|&unit| buf.format(self.to_unit(unit)).len()) + .min_by_key(|&unit| self.to_unit(unit).to_string().len()) .unwrap(); - write!(f, "{}{}", buf.format(self.to_unit(unit)), unit) + write!(f, "{}{}", self.to_unit(unit), unit) } } |
