Skip to content

Commit 4451ac0

Browse files
authored
Merge pull request #1518 from khandrym/allow-dead_code
Move allow dead code attribute and add comment
2 parents d504324 + eee2828 commit 4451ac0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/custom_types/structs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ There are three types of structures ("structs") that can be created using the
88
* Unit structs, which are field-less, are useful for generics.
99

1010
```rust,editable
11+
// An attribute to hide warnings for unused code.
12+
#![allow(dead_code)]
13+
1114
#[derive(Debug)]
1215
struct Person {
1316
name: String,
@@ -27,7 +30,6 @@ struct Point {
2730
}
2831
2932
// Structs can be reused as fields of another struct
30-
#[allow(dead_code)]
3133
struct Rectangle {
3234
// A rectangle can be specified by where the top left and bottom right
3335
// corners are in space.

0 commit comments

Comments
 (0)