Skip to content

Commit

Permalink
feat: use addr_of! instead to create a raw pointer (#714)
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker authored Sep 1, 2024
1 parent b3640ec commit 5ae44af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/storage/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use junobuild_shared::types::core::Blob;
use junobuild_shared::types::state::Controllers;
use junobuild_shared::utils::principal_not_equal;
use std::collections::HashMap;
use std::ptr::addr_of;

///
/// Upload batch and chunks
Expand Down Expand Up @@ -88,7 +89,7 @@ fn create_batch_impl(
};

insert_runtime_batch(
&NEXT_BATCH_ID,
&*addr_of!(NEXT_BATCH_ID),
Batch {
key,
reference_id,
Expand Down Expand Up @@ -136,7 +137,7 @@ pub fn create_chunk(
NEXT_CHUNK_ID += 1;

insert_runtime_chunk(
&NEXT_CHUNK_ID,
&*addr_of!(NEXT_CHUNK_ID),
Chunk {
batch_id,
content,
Expand Down

0 comments on commit 5ae44af

Please sign in to comment.