Skip to content

Commit 445c4da

Browse files
michielp1807folkertdev
authored andcommitted
Use ddict.as_mut().unwrap() instead of &mut *ddict
1 parent e285fc2 commit 445c4da

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/decompress/zstd_ddict.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,14 @@ pub unsafe extern "C" fn ZSTD_createDDict_advanced(
217217
}
218218

219219
(*ddict).cMem = customMem;
220-
if ZSTD_initDDict_internal(&mut *ddict, dict, dictSize, dictLoadMethod, dictContentType)
221-
.is_err()
220+
if ZSTD_initDDict_internal(
221+
ddict.as_mut().unwrap(),
222+
dict,
223+
dictSize,
224+
dictLoadMethod,
225+
dictContentType,
226+
)
227+
.is_err()
222228
{
223229
ZSTD_freeDDict(ddict);
224230
return core::ptr::null_mut();
@@ -282,7 +288,7 @@ pub unsafe extern "C" fn ZSTD_initStaticDDict(
282288
}
283289

284290
if ZSTD_initDDict_internal(
285-
&mut *ddict,
291+
ddict.as_mut().unwrap(),
286292
dict,
287293
dictSize,
288294
DictLoadMethod::ByRef as _,

0 commit comments

Comments
 (0)