Skip to content

Commit

Permalink
struct_visibility.md: Remove unneeded '#[allow(dead_code)]' (#1609)
Browse files Browse the repository at this point in the history
Directive to allow dead code on struct ClosedBox is not needed and confusing.  It is used when calling using the public constructor about line 44: `let _closed_box = my::ClosedBox::new("classified information");`
  • Loading branch information
merriam authored Sep 14, 2022
1 parent d1db42f commit 767a6bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mod/struct_visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod my {
}
// A public struct with a private field of generic type `T`
#[allow(dead_code)]
pub struct ClosedBox<T> {
contents: T,
}
Expand Down Expand Up @@ -56,4 +55,4 @@ fn main() {
[generics][generics] and [methods][methods]

[generics]: ../generics.md
[methods]: ../fn/methods.md
[methods]: ../fn/methods.md

0 comments on commit 767a6bd

Please sign in to comment.