Skip to content

Commit 6e31608

Browse files
committed
tweak format::Info raw object construction
1 parent 37ca372 commit 6e31608

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pulse-binding/src/format.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,17 @@ impl Info {
213213
assert_eq!(false, ptr.is_null());
214214
// Note, yes, this should be weak; the ‘free’ function for a format info object free’s its
215215
// own proplist!
216-
unsafe { Self { ptr: ptr, properties: Proplist::from_raw_weak((*ptr).list), weak: false } }
216+
let pl = Proplist::from_raw_weak(unsafe { (*ptr).list });
217+
Self { ptr: ptr, properties: pl, weak: false }
217218
}
218219

219220
/// Creates a new `Info` from an existing [`InfoInternal`] pointer.
220221
///
221222
/// This is the ‘weak’ version, which avoids destroying the internal object when dropped.
222223
pub(crate) fn from_raw_weak(ptr: *mut InfoInternal) -> Self {
223224
assert_eq!(false, ptr.is_null());
224-
unsafe { Self { ptr: ptr, properties: Proplist::from_raw_weak((*ptr).list), weak: true } }
225+
let pl = Proplist::from_raw_weak(unsafe { (*ptr).list });
226+
Self { ptr: ptr, properties: pl, weak: true }
225227
}
226228

227229
/// Returns a new `Info` struct representing the same format.

0 commit comments

Comments
 (0)