Skip to content

Commit 62ae613

Browse files
committed
Improve documentation for non-macro-dropped structs
1 parent 7148fac commit 62ae613

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/openvino/src/partial_shape.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ pub struct PartialShape {
1313
}
1414

1515
impl 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
}

crates/openvino/src/shape.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ pub struct Shape {
88
}
99

1010
impl 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);

0 commit comments

Comments
 (0)