Skip to content

Commit 19f3121

Browse files
committed
rename for name consistency
1 parent 9c8ace5 commit 19f3121

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

stdlib/src/array.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ mod array {
287287
match self {
288288
$(ArrayContentType::$n(v) => {
289289
let value = <$t>::try_into_from_object(vm, value)?;
290-
v.set_item_by_index(vm, i, value)
290+
v.setitem_by_index(vm, i, value)
291291
})*
292292
}
293293
}
@@ -300,7 +300,7 @@ mod array {
300300
) -> PyResult<()> {
301301
match self {
302302
$(Self::$n(elements) => if let ArrayContentType::$n(items) = items {
303-
elements.set_item_by_slice(vm, slice, items)
303+
elements.setitem_by_slice(vm, slice, items)
304304
} else {
305305
Err(vm.new_type_error(
306306
"bad argument type for built-in operation".to_owned()
@@ -317,7 +317,7 @@ mod array {
317317
) -> PyResult<()> {
318318
match self {
319319
$(Self::$n(elements) => if let ArrayContentType::$n(items) = items {
320-
elements.set_item_by_slice_no_resize(vm, slice, items)
320+
elements.setitem_by_slice_no_resize(vm, slice, items)
321321
} else {
322322
Err(vm.new_type_error(
323323
"bad argument type for built-in operation".to_owned()

vm/src/builtins/bytearray.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl PyByteArray {
160160

161161
fn _setitem_by_index(&self, i: isize, value: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
162162
let value = value_from_object(vm, &value)?;
163-
self.borrow_buf_mut().set_item_by_index(vm, i, value)
163+
self.borrow_buf_mut().setitem_by_index(vm, i, value)
164164
}
165165

166166
fn _setitem(
@@ -178,10 +178,10 @@ impl PyByteArray {
178178
bytes_from_object(vm, &value)?
179179
};
180180
if let Some(mut w) = zelf.try_resizable_opt() {
181-
w.elements.set_item_by_slice(vm, slice, &items)
181+
w.elements.setitem_by_slice(vm, slice, &items)
182182
} else {
183183
zelf.borrow_buf_mut()
184-
.set_item_by_slice_no_resize(vm, slice, &items)
184+
.setitem_by_slice_no_resize(vm, slice, &items)
185185
}
186186
}
187187
}

vm/src/builtins/list.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ impl PyList {
213213

214214
fn _setitem(&self, needle: &PyObject, value: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
215215
match SequenceIndex::try_from_borrowed_object(vm, needle, "list")? {
216-
SequenceIndex::Int(index) => self.borrow_vec_mut().set_item_by_index(vm, index, value),
216+
SequenceIndex::Int(index) => self.borrow_vec_mut().setitem_by_index(vm, index, value),
217217
SequenceIndex::Slice(slice) => {
218218
let sec = extract_cloned(&*value, Ok, vm)?;
219-
self.borrow_vec_mut().set_item_by_slice(vm, slice, &sec)
219+
self.borrow_vec_mut().setitem_by_slice(vm, slice, &sec)
220220
}
221221
}
222222
}
@@ -451,7 +451,7 @@ impl AsSequence for PyList {
451451
ass_item: Some(|seq, i, value, vm| {
452452
let zelf = Self::sequence_downcast(seq);
453453
if let Some(value) = value {
454-
zelf.borrow_vec_mut().set_item_by_index(vm, i, value)
454+
zelf.borrow_vec_mut().setitem_by_index(vm, i, value)
455455
} else {
456456
zelf.borrow_vec_mut().del_item_by_index(vm, i)
457457
}

vm/src/sliceable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ where
2424
where
2525
I: Iterator<Item = usize>;
2626

27-
fn set_item_by_index(
27+
fn setitem_by_index(
2828
&mut self,
2929
vm: &VirtualMachine,
3030
index: isize,
@@ -38,7 +38,7 @@ where
3838
Ok(())
3939
}
4040

41-
fn set_item_by_slice_no_resize(
41+
fn setitem_by_slice_no_resize(
4242
&mut self,
4343
vm: &VirtualMachine,
4444
slice: SaturatedSlice,
@@ -60,7 +60,7 @@ where
6060
}
6161
}
6262

63-
fn set_item_by_slice(
63+
fn setitem_by_slice(
6464
&mut self,
6565
vm: &VirtualMachine,
6666
slice: SaturatedSlice,

0 commit comments

Comments
 (0)