Skip to content

Commit e06e45a

Browse files
committed
insert hidden definition of Vec3 so docs compile
1 parent 59c3aa1 commit e06e45a

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,27 @@ declare_clippy_lint! {
2828
///
2929
/// ```rust
3030
/// struct Vec3 {
31-
/// x: f64,
32-
/// y: f64,
33-
/// z: f64,
34-
///}
31+
/// x: f64,
32+
/// y: f64,
33+
/// z: f64,
34+
/// }
3535
///
36-
///impl Eq for Vec3 {}
36+
/// impl Eq for Vec3 {}
3737
///
38-
///impl PartialEq for Vec3 {
39-
/// fn eq(&self, other: &Self) -> bool {
40-
/// // This should trigger the lint because `self.x` is compared to `other.y`
41-
/// self.x == other.y && self.y == other.y && self.z == other.z
42-
/// }
43-
///}
38+
/// impl PartialEq for Vec3 {
39+
/// fn eq(&self, other: &Self) -> bool {
40+
/// // This should trigger the lint because `self.x` is compared to `other.y`
41+
/// self.x == other.y && self.y == other.y && self.z == other.z
42+
/// }
43+
/// }
4444
/// ```
4545
/// Use instead:
4646
/// ```rust
47+
/// #struct Vec3 {
48+
/// # x: f64,
49+
/// # y: f64,
50+
/// # z: f64,
51+
/// #}
4752
/// // same as above except:
4853
/// impl PartialEq for Vec3 {
4954
/// fn eq(&self, other: &Self) -> bool {

0 commit comments

Comments
 (0)