Skip to content

Commit

Permalink
Add comment to explain why we do what we do
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 20, 2025
1 parent a9dbf57 commit 73dfb4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/build/re_types_builder/src/codegen/rust/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ fn quote_arrow_field_serializer(
);

// Offsets is always non-empty. The last element is the total length of buffer we need.
// We want this capacity in order to allocate exactly as much memory as we need.
#[allow(clippy::unwrap_used)]
let capacity = offsets.last().copied().unwrap() as usize;

Expand All @@ -645,6 +646,7 @@ fn quote_arrow_field_serializer(
);

// Offsets is always non-empty. The last element is the total length of buffer we need.
// We want this capacity in order to allocate exactly as much memory as we need.
#[allow(clippy::unwrap_used)]
let capacity = offsets.last().copied().unwrap() as usize;

Expand Down

0 comments on commit 73dfb4b

Please sign in to comment.