From 9a01cb2ea47ce9c7f46cf80a30f03db949f186e1 Mon Sep 17 00:00:00 2001 From: Zi Fan Date: Sat, 27 Jul 2024 14:48:26 -0700 Subject: [PATCH] Fix syntax error (#61) --- booksrc/chapter-simple-bump.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/booksrc/chapter-simple-bump.md b/booksrc/chapter-simple-bump.md index d2657ee..c73f1ad 100644 --- a/booksrc/chapter-simple-bump.md +++ b/booksrc/chapter-simple-bump.md @@ -49,7 +49,7 @@ impl BumpBlock { let cursor_ptr = self.cursor as usize; // align to word boundary - let align_mask = usize = !(size_of::() - 1); + let align_mask: usize = !(size_of::() - 1); let next_ptr = cursor_ptr.checked_sub(alloc_size)? & align_mask; @@ -73,7 +73,7 @@ object. Fortunately, by bump allocating downward we can apply a simple mask to t pointer to align it down to the nearest word: ```rust,ignore - let align_mask = usize = !(size_of::() - 1); + let align_mask: usize = !(size_of::() - 1); ``` In initial implementation, allocation will simply return `None` if the block