We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d504324 + eee2828 commit 4451ac0Copy full SHA for 4451ac0
src/custom_types/structs.md
@@ -8,6 +8,9 @@ There are three types of structures ("structs") that can be created using the
8
* Unit structs, which are field-less, are useful for generics.
9
10
```rust,editable
11
+// An attribute to hide warnings for unused code.
12
+#![allow(dead_code)]
13
+
14
#[derive(Debug)]
15
struct Person {
16
name: String,
@@ -27,7 +30,6 @@ struct Point {
27
30
}
28
31
29
32
// Structs can be reused as fields of another struct
-#[allow(dead_code)]
33
struct Rectangle {
34
// A rectangle can be specified by where the top left and bottom right
35
// corners are in space.
0 commit comments