Skip to content

Commit

Permalink
docs: Add comments explaining use of boxed_fut
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 committed Feb 15, 2024
1 parent 500a6c2 commit 3d5793e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions wnfs-hamt/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ where

let mut pointers = Vec::with_capacity(self.pointers.len());
for pointer in self.pointers.iter() {
// Boxing the future due to recursion
pointers.push(boxed_fut(pointer.to_serializable(store)).await?);
}

Expand Down
1 change: 1 addition & 0 deletions wnfs/src/public/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ impl Storable for PublicDirectory {
let userland = {
let mut map = BTreeMap::new();
for (name, link) in self.userland.iter() {
// Boxing the future due to recursion
map.insert(name.clone(), boxed_fut(link.resolve_cid(store)).await?);
}
map
Expand Down

0 comments on commit 3d5793e

Please sign in to comment.