Skip to content

Commit 767a6bd

Browse files
authored
struct_visibility.md: Remove unneeded '#[allow(dead_code)]' (#1609)
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");`
1 parent d1db42f commit 767a6bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/mod/struct_visibility.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod my {
1313
}
1414
1515
// A public struct with a private field of generic type `T`
16-
#[allow(dead_code)]
1716
pub struct ClosedBox<T> {
1817
contents: T,
1918
}
@@ -56,4 +55,4 @@ fn main() {
5655
[generics][generics] and [methods][methods]
5756

5857
[generics]: ../generics.md
59-
[methods]: ../fn/methods.md
58+
[methods]: ../fn/methods.md

0 commit comments

Comments
 (0)