From 767a6bd9727a596d7cfdbaeee475e65b2670ea3a Mon Sep 17 00:00:00 2001 From: Charles Merriam Date: Wed, 14 Sep 2022 05:17:18 -0700 Subject: [PATCH] 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");` --- src/mod/struct_visibility.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mod/struct_visibility.md b/src/mod/struct_visibility.md index e7359413c7..8641a72645 100644 --- a/src/mod/struct_visibility.md +++ b/src/mod/struct_visibility.md @@ -13,7 +13,6 @@ mod my { } // A public struct with a private field of generic type `T` - #[allow(dead_code)] pub struct ClosedBox { contents: T, } @@ -56,4 +55,4 @@ fn main() { [generics][generics] and [methods][methods] [generics]: ../generics.md -[methods]: ../fn/methods.md \ No newline at end of file +[methods]: ../fn/methods.md