Fixed borked panic message in Buffer::from_data / Buffer::from_inter (#2292)

This commit is contained in:
marc0246 2023-08-17 18:32:08 +02:00 committed by GitHub
parent 2d391f3760
commit ff7b4fc90e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,9 +252,7 @@ impl Buffer {
let buffer = Buffer::new_sized(allocator, create_info, allocation_info)?;
{
let mut write_guard = buffer
.write()
.expect("the buffer is somehow in use before we returned it to the user");
let mut write_guard = buffer.write().unwrap();
*write_guard = data;
}
@ -293,9 +291,7 @@ impl Buffer {
)?;
{
let mut write_guard = buffer
.write()
.expect("the buffer is somehow in use before we returned it to the user");
let mut write_guard = buffer.write().unwrap();
for (o, i) in write_guard.iter_mut().zip(iter) {
*o = i;