File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 68
68
//!
69
69
//! ```c
70
70
//! /* C header */
71
- //! struct Foo* foo( ); /* Returns ownership */
72
- //! void bar (struct Foo*); /* `bar` takes ownership */
71
+ //! struct Foo* foo_new(void ); /* Returns ownership to the caller */
72
+ //! void foo_delete (struct Foo*); /* Takes ownership from the caller */
73
73
//! ```
74
74
//!
75
75
//! ```
76
76
//! #[repr(C)]
77
77
//! pub struct Foo;
78
78
//!
79
79
//! #[no_mangle]
80
- //! pub extern "C" fn foo () -> Box<Foo> {
80
+ //! pub extern "C" fn foo_new () -> Box<Foo> {
81
81
//! Box::new(Foo)
82
82
//! }
83
83
//!
84
84
//! #[no_mangle]
85
- //! pub extern "C" fn bar (_: Option<Box<Foo>>) {}
85
+ //! pub extern "C" fn foo_delete (_: Option<Box<Foo>>) {}
86
86
//! ```
87
87
//!
88
88
//! [dereferencing]: ../../std/ops/trait.Deref.html
You can’t perform that action at this time.
0 commit comments