book: updates visibility example code
diff --git a/book/src/visibility.md b/book/src/visibility.md index ac0aac1..c85ab27 100644 --- a/book/src/visibility.md +++ b/book/src/visibility.md
@@ -23,15 +23,24 @@ Then in Rust: ```rust -# #[repr(C)] -# pub struct OneFieldPrivate { -# s: *const ::std::os::raw::c_char, -# pub b: bool, -# } - impl OneFieldPrivate { pub fn new(s: &'static std::ffi::CStr, b: bool) -> Self { OneFieldPrivate { s: s.as_ptr(), b } } } + +// generated by bindgen +#[repr(C)] +pub struct OneFieldPrivate { + s: *const ::std::os::raw::c_char, + pub b: bool, +} + +// generated by bindgen +#[repr(C)] +pub struct MostFieldsPrivate { + a: ::std::os::raw::c_int, + b: bool, + pub c: ::std::os::raw::c_char, +} ```