[wasm-rust] panic if buffer_set_contents fails

This commit is contained in:
Simon Cozens authored and Behdad Esfahbod committed 2023-03-31 17:33:45 -06:00
1 parent 74a2f338c6
commit e78d8653ce
1 file changed
+3 -1
+3 -1
View File
@@ -304,7 +304,9 @@ impl<T: BufferItem> Drop for Buffer<T> {
position: positions[..].as_mut_ptr(),
};
unsafe {
buffer_set_contents(self._ptr, &c_contents);
if !buffer_set_contents(self._ptr, &c_contents) {
panic!("Couldn't set buffer contents");
}
}
}
}