File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ pub struct PartialShape {
1313}
1414
1515impl Drop for PartialShape {
16- /// Drops the `PartialShape` instance and frees the associated memory.
16+ // We don't use the `drop...!` macro here since:
17+ // - the `instance` field is not a pointer as with other types.
1718 fn drop ( & mut self ) {
1819 unsafe { ov_partial_shape_free ( std:: ptr:: addr_of_mut!( self . instance) ) }
1920 }
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ pub struct Shape {
88}
99
1010impl Drop for Shape {
11- /// Drops the Shape instance and frees the associated memory.
12- //Not using drop! macro since ov_shape_free returns an error code unlike other free methods.
11+ // We don't use the `drop...!` macro here since:
12+ // - `ov_shape_free` returns an error code unlike other free methods
13+ // - the `instance` field is not a pointer as with other types.
1314 fn drop ( & mut self ) {
1415 let code = unsafe { ov_shape_free ( std:: ptr:: addr_of_mut!( self . instance) ) } ;
1516 assert_eq ! ( code, 0 ) ;
You can’t perform that action at this time.
0 commit comments