aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api/src/vmstate.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-01-23 11:25:22 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-01-23 18:47:46 +0100
commit7d0520398f7f58214cf5242b34c1b46efa2fcf4f (patch)
tree1aa706baadc819ff3f569af00c91ba99fe4696fd /rust/qemu-api/src/vmstate.rs
parent24f0e8d818b931758b6dc47f973a6b1b80ecee1f (diff)
downloadqemu-7d0520398f7f58214cf5242b34c1b46efa2fcf4f.zip
qemu-7d0520398f7f58214cf5242b34c1b46efa2fcf4f.tar.gz
qemu-7d0520398f7f58214cf5242b34c1b46efa2fcf4f.tar.bz2
rust: prefer NonNull::new to assertions
Do not use new_unchecked; the effect is the same, but the code is easier to read and unsafe regions become smaller. Likewise, NonNull::new can be used instead of assertion and followed by as_ref() or as_mut() instead of dereferencing the pointer. Suggested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/vmstate.rs')
0 files changed, 0 insertions, 0 deletions