Skip to content

Commit

Permalink
Merge pull request #1518 from khandrym/allow-dead_code
Browse files Browse the repository at this point in the history
Move allow dead code attribute and add comment
  • Loading branch information
marioidival authored Mar 21, 2022
2 parents d504324 + eee2828 commit 4451ac0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom_types/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ There are three types of structures ("structs") that can be created using the
* Unit structs, which are field-less, are useful for generics.

```rust,editable
// An attribute to hide warnings for unused code.
#![allow(dead_code)]
#[derive(Debug)]
struct Person {
name: String,
Expand All @@ -27,7 +30,6 @@ struct Point {
}
// Structs can be reused as fields of another struct
#[allow(dead_code)]
struct Rectangle {
// A rectangle can be specified by where the top left and bottom right
// corners are in space.
Expand Down

0 comments on commit 4451ac0

Please sign in to comment.