Skip to content

Commit

Permalink
Add missing unsafe to an example in the 0.21 migration guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
argv-minus-one committed Feb 1, 2023
1 parent 003dbe1 commit 1b56c74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/0.21-MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ It's now possible to read and write elements via the `Deref` and `DerefMut` trai
let byte_array = env.new_byte_array(100)?;

{
let mut elements = env.get_array_elements(&byte_array, ReleaseMode::CopyBack)?;
let mut elements = unsafe { env.get_array_elements(&byte_array, ReleaseMode::CopyBack) }?;

elements[0] = 0xff;
assert_eq!(elements[0], 0xff);
Expand Down

0 comments on commit 1b56c74

Please sign in to comment.