mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Make new method const
This commit is contained in:
1 parent
efc6b5dbaf
commit
e03f762b20
1 file changed
+2
-1
@@ -107,6 +107,7 @@ where
|
||||
O: Borrow<PyObject>,
|
||||
{
|
||||
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<PyObject>,
|
||||
{
|
||||
pub fn new(vm: &'a VirtualMachine, obj: O, length_hint: Option<usize>) -> Self {
|
||||
pub const fn new(vm: &'a VirtualMachine, obj: O, length_hint: Option<usize>) -> Self {
|
||||
Self {
|
||||
vm,
|
||||
obj,
|
||||
|
||||
Reference in new issue
Block a user