From 8c4f8c341d7e2df7e4d1ff604eee74e3e12ed773 Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Wed, 21 Jan 2026 09:26:30 +0100 Subject: [PATCH] Inline SizableContainer functions for Vec Inline the functions in the `SizableContainer` implementation for `Vec`. I noticed while looking through performance traces that the function wasn't inlined in `push_into` frames, as it should've been. Signed-off-by: Moritz Hoffmann --- container/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container/src/lib.rs b/container/src/lib.rs index 83d5f528e..06351bbb7 100644 --- a/container/src/lib.rs +++ b/container/src/lib.rs @@ -187,10 +187,10 @@ impl DrainContainer for Vec { } impl SizableContainer for Vec { - fn at_capacity(&self) -> bool { + #[inline] fn at_capacity(&self) -> bool { self.len() == self.capacity() } - fn ensure_capacity(&mut self, stash: &mut Option) { + #[inline] fn ensure_capacity(&mut self, stash: &mut Option) { if self.capacity() == 0 { *self = stash.take().unwrap_or_default(); self.clear();