diff options
| author | Eric Biedert <github@ericbiedert.de> | 2023-04-11 14:13:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-11 14:13:01 +0200 |
| commit | c7db709da53e0559adabc99d483a374224ef5ce8 (patch) | |
| tree | 22ab5ce508bb1ba6aafd9b2c61066069b9e771ab /src/geom | |
| parent | ef50f1b011af61d7f145fcbb25e90fb002d5f785 (diff) | |
Allow treating ratios as floats (#681)
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/ratio.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/geom/ratio.rs b/src/geom/ratio.rs index 5490bcba..fe87dd6c 100644 --- a/src/geom/ratio.rs +++ b/src/geom/ratio.rs @@ -110,6 +110,14 @@ impl Div<f64> for Ratio { } } +impl Div<Ratio> for f64 { + type Output = Self; + + fn div(self, other: Ratio) -> Self { + self / other.get() + } +} + impl Div for Ratio { type Output = f64; |
