Skip to content

Commit 1479c84

Browse files
committed
Work around documentation bug:
rust-lang/rust#40395
1 parent c9e8ef7 commit 1479c84

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/lib.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,14 +1113,16 @@ impl<T> Mul<T> for Vector3<T>
11131113
}
11141114
}
11151115

1116-
impl Div<Float> for Vector3f
1116+
// work around bug
1117+
// https://github.com/rust-lang/rust/issues/40395
1118+
impl Div<Float> for Vector3<f32>
11171119
{
1118-
type Output = Vector3f;
1119-
fn div(self, rhs: Float) -> Vector3f
1120+
type Output = Vector3<f32>;
1121+
fn div(self, rhs: Float) -> Vector3<f32>
11201122
{
11211123
assert_ne!(rhs, 0.0 as Float);
11221124
let inv: Float = 1.0 as Float / rhs;
1123-
Vector3f {
1125+
Vector3::<f32> {
11241126
x: self.x * inv,
11251127
y: self.y * inv,
11261128
z: self.z * inv,
@@ -1532,22 +1534,26 @@ impl<T> MulAssign<T> for Point3<T>
15321534
}
15331535
}
15341536

1535-
impl Div<Float> for Point3f
1537+
// work around bug
1538+
// https://github.com/rust-lang/rust/issues/40395
1539+
impl Div<Float> for Point3<f32>
15361540
{
1537-
type Output = Point3f;
1538-
fn div(self, rhs: Float) -> Point3f
1541+
type Output = Point3<f32>;
1542+
fn div(self, rhs: Float) -> Point3<f32>
15391543
{
15401544
assert_ne!(rhs, 0.0 as Float);
15411545
let inv: Float = 1.0 as Float / rhs;
1542-
Point3f {
1546+
Point3::<f32> {
15431547
x: self.x * inv,
15441548
y: self.y * inv,
15451549
z: self.z * inv,
15461550
}
15471551
}
15481552
}
15491553

1550-
impl DivAssign<Float> for Point3f
1554+
// work around bug
1555+
// https://github.com/rust-lang/rust/issues/40395
1556+
impl DivAssign<Float> for Point3<f32>
15511557
{
15521558
fn div_assign(&mut self, rhs: Float) {
15531559
assert_ne!(rhs, 0.0 as Float);

0 commit comments

Comments
 (0)