From e03f762b208002775715cfba287dc07d87ed6410 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:39:45 +0300 Subject: [PATCH] Make `new` method const --- vm/src/protocol/iter.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/src/protocol/iter.rs b/vm/src/protocol/iter.rs index 254134991..34f1b01ca 100644 --- a/vm/src/protocol/iter.rs +++ b/vm/src/protocol/iter.rs @@ -107,6 +107,7 @@ where O: Borrow, { type Target = PyObject; + #[inline(always)] fn deref(&self) -> &Self::Target { self.0.borrow() @@ -242,7 +243,7 @@ impl<'a, T, O> PyIterIter<'a, T, O> where O: Borrow, { - pub fn new(vm: &'a VirtualMachine, obj: O, length_hint: Option) -> Self { + pub const fn new(vm: &'a VirtualMachine, obj: O, length_hint: Option) -> Self { Self { vm, obj,