Skip to content

Commit 2acacec

Browse files
committed
Callable::call -> PyType::call for readability
1 parent c086e17 commit 2acacec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vm/src/builtins/bytearray.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::common::{
1212
};
1313
use crate::{
1414
anystr::{self, AnyStr},
15+
builtins::PyType,
1516
bytesinner::{
1617
bytes_decode, bytes_from_object, value_from_object, ByteInnerFindOptions,
1718
ByteInnerNewOptions, ByteInnerPaddingOptions, ByteInnerSplitOptions,
@@ -393,7 +394,7 @@ impl PyByteArray {
393394
fn fromhex(cls: PyTypeRef, string: PyStrRef, vm: &VirtualMachine) -> PyResult {
394395
let bytes = PyBytesInner::fromhex(string.as_str(), vm)?;
395396
let bytes = vm.ctx.new_bytes(bytes);
396-
Callable::call(&cls, vec![bytes.into()].into(), vm)
397+
PyType::call(&cls, vec![bytes.into()].into(), vm)
397398
}
398399

399400
#[pymethod]

vm/src/builtins/bytes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use super::{PositionIterInternal, PyDictRef, PyIntRef, PyStrRef, PyTuple, PyTupleRef, PyTypeRef};
22
use crate::{
33
anystr::{self, AnyStr},
4+
builtins::PyType,
45
bytesinner::{
56
bytes_decode, ByteInnerFindOptions, ByteInnerNewOptions, ByteInnerPaddingOptions,
67
ByteInnerSplitOptions, ByteInnerTranslateOptions, DecodeArgs, PyBytesInner,
@@ -245,7 +246,7 @@ impl PyBytes {
245246
fn fromhex(cls: PyTypeRef, string: PyStrRef, vm: &VirtualMachine) -> PyResult {
246247
let bytes = PyBytesInner::fromhex(string.as_str(), vm)?;
247248
let bytes = vm.ctx.new_bytes(bytes).into();
248-
Callable::call(&cls, vec![bytes].into(), vm)
249+
PyType::call(&cls, vec![bytes].into(), vm)
249250
}
250251

251252
#[pymethod]

0 commit comments

Comments
 (0)