Skip to content

Commit 8b5151f

Browse files
Auto-format: cargo fmt --all
1 parent 2f297e4 commit 8b5151f

File tree

16 files changed

+57
-57
lines changed

16 files changed

+57
-57
lines changed

crates/stdlib/src/array.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ mod array {
10591059
self.delitem_inner(&needle, vm)
10601060
}
10611061

1062-
fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
1062+
fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
10631063
if let Some(other) = other.downcast_ref::<Self>() {
10641064
self.read()
10651065
.add(&other.read(), vm)
@@ -1072,7 +1072,7 @@ mod array {
10721072
}
10731073
}
10741074

1075-
fn __iadd__(
1075+
fn __iadd__(
10761076
zelf: PyRef<Self>,
10771077
other: PyObjectRef,
10781078
vm: &VirtualMachine,
@@ -1090,13 +1090,13 @@ mod array {
10901090
Ok(zelf)
10911091
}
10921092

1093-
fn __mul__(&self, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
1093+
fn __mul__(&self, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
10941094
self.read()
10951095
.mul(value, vm)
10961096
.map(|x| Self::from(x).into_ref(&vm.ctx))
10971097
}
10981098

1099-
fn __imul__(zelf: PyRef<Self>, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
1099+
fn __imul__(zelf: PyRef<Self>, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
11001100
zelf.try_resizable(vm)?.imul(value, vm)?;
11011101
Ok(zelf)
11021102
}

crates/vm/src/builtins/bytearray.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl PyByteArray {
216216
size_of::<Self>() + self.borrow_buf().len() * size_of::<u8>()
217217
}
218218

219-
fn __add__(&self, other: ArgBytesLike) -> Self {
219+
fn __add__(&self, other: ArgBytesLike) -> Self {
220220
self.inner().add(&other.borrow_buf()).into()
221221
}
222222

@@ -229,7 +229,7 @@ impl PyByteArray {
229229
self.inner().contains(needle, vm)
230230
}
231231

232-
fn __iadd__(
232+
fn __iadd__(
233233
zelf: PyRef<Self>,
234234
other: ArgBytesLike,
235235
vm: &VirtualMachine,
@@ -523,11 +523,11 @@ impl PyByteArray {
523523
self.inner().title().into()
524524
}
525525

526-
fn __mul__(&self, value: ArgSize, vm: &VirtualMachine) -> PyResult<Self> {
526+
fn __mul__(&self, value: ArgSize, vm: &VirtualMachine) -> PyResult<Self> {
527527
self.repeat(value.into(), vm)
528528
}
529529

530-
fn __imul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
530+
fn __imul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
531531
Self::irepeat(&zelf, value.into(), vm)?;
532532
Ok(zelf)
533533
}
@@ -538,7 +538,7 @@ impl PyByteArray {
538538
Ok(formatted.into())
539539
}
540540

541-
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
541+
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
542542
vm.ctx.not_implemented()
543543
}
544544

crates/vm/src/builtins/bytes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl PyBytes {
225225
size_of::<Self>() + self.len() * size_of::<u8>()
226226
}
227227

228-
fn __add__(&self, other: ArgBytesLike) -> Vec<u8> {
228+
fn __add__(&self, other: ArgBytesLike) -> Vec<u8> {
229229
self.inner.add(&other.borrow_buf())
230230
}
231231

@@ -512,7 +512,7 @@ impl PyBytes {
512512
self.inner.title().into()
513513
}
514514

515-
fn __mul__(zelf: PyRef<Self>, value: ArgIndex, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
515+
fn __mul__(zelf: PyRef<Self>, value: ArgIndex, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
516516
zelf.repeat(value.try_to_primitive(vm)?, vm)
517517
}
518518

@@ -522,7 +522,7 @@ impl PyBytes {
522522
Ok(formatted.into())
523523
}
524524

525-
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
525+
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
526526
vm.ctx.not_implemented()
527527
}
528528

crates/vm/src/builtins/dict.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl PyDict {
294294
Ok(())
295295
}
296296

297-
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
297+
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
298298
let other_dict: Result<PyDictRef, _> = other.downcast();
299299
if let Ok(other) = other_dict {
300300
let self_cp = self.copy();
@@ -403,12 +403,12 @@ impl PyRef<PyDict> {
403403
PyDictReverseKeyIterator::new(self)
404404
}
405405

406-
fn __ior__(self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<Self> {
406+
fn __ior__(self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<Self> {
407407
self.merge_object(other, vm)?;
408408
Ok(self)
409409
}
410410

411-
fn __ror__(self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
411+
fn __ror__(self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
412412
let other_dict: Result<Self, _> = other.downcast();
413413
if let Ok(other) = other_dict {
414414
let other_cp = other.copy();
@@ -1045,31 +1045,31 @@ trait ViewSetOps: DictView {
10451045
PySetInner::from_iter(iter, vm)
10461046
}
10471047

1048-
fn __xor__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1048+
fn __xor__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
10491049
let zelf = Self::to_set(zelf, vm)?;
10501050
let inner = zelf.symmetric_difference(other, vm)?;
10511051
Ok(PySet { inner })
10521052
}
10531053

1054-
fn __and__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1054+
fn __and__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
10551055
let zelf = Self::to_set(zelf, vm)?;
10561056
let inner = zelf.intersection(other, vm)?;
10571057
Ok(PySet { inner })
10581058
}
10591059

1060-
fn __or__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1060+
fn __or__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
10611061
let zelf = Self::to_set(zelf, vm)?;
10621062
let inner = zelf.union(other, vm)?;
10631063
Ok(PySet { inner })
10641064
}
10651065

1066-
fn __sub__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1066+
fn __sub__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
10671067
let zelf = Self::to_set(zelf, vm)?;
10681068
let inner = zelf.difference(other, vm)?;
10691069
Ok(PySet { inner })
10701070
}
10711071

1072-
fn __rsub__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1072+
fn __rsub__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
10731073
let left = PySetInner::from_iter(other.iter(vm)?, vm)?;
10741074
let right = ArgIterable::try_from_object(vm, Self::iter(zelf, vm)?)?;
10751075
let inner = left.difference(right, vm)?;

crates/vm/src/builtins/genericalias.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ impl PyGenericAlias {
236236
Err(vm.new_type_error("issubclass() argument 2 cannot be a parameterized generic"))
237237
}
238238

239-
fn __ror__(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
239+
fn __ror__(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
240240
type_::or_(other, zelf, vm)
241241
}
242242

243-
fn __or__(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
243+
fn __or__(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
244244
type_::or_(zelf, other, vm)
245245
}
246246
}

crates/vm/src/builtins/list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl PyList {
144144
Ok(Self::from(elements).into_ref(&vm.ctx))
145145
}
146146

147-
fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
147+
fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
148148
self.concat(&other, vm)
149149
}
150150

@@ -158,7 +158,7 @@ impl PyList {
158158
Ok(zelf.to_owned().into())
159159
}
160160

161-
fn __iadd__(
161+
fn __iadd__(
162162
zelf: PyRef<Self>,
163163
other: PyObjectRef,
164164
vm: &VirtualMachine,
@@ -239,11 +239,11 @@ impl PyList {
239239
}
240240

241241
#[pymethod]
242-
fn __mul__(&self, n: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
242+
fn __mul__(&self, n: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
243243
self.repeat(n.into(), vm)
244244
}
245245

246-
fn __imul__(zelf: PyRef<Self>, n: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
246+
fn __imul__(zelf: PyRef<Self>, n: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
247247
Self::irepeat(zelf, n.into(), vm)
248248
}
249249

crates/vm/src/builtins/mappingproxy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ impl PyMappingProxy {
188188
)
189189
}
190190

191-
fn __ior__(&self, _args: PyObjectRef, vm: &VirtualMachine) -> PyResult {
191+
fn __ior__(&self, _args: PyObjectRef, vm: &VirtualMachine) -> PyResult {
192192
Err(vm.new_type_error(format!(
193193
r#""'|=' is not supported by {}; use '|' instead""#,
194194
Self::class(&vm.ctx)
195195
)))
196196
}
197197

198-
fn __or__(&self, args: PyObjectRef, vm: &VirtualMachine) -> PyResult {
198+
fn __or__(&self, args: PyObjectRef, vm: &VirtualMachine) -> PyResult {
199199
vm._or(self.copy(vm)?.as_ref(), args.as_ref())
200200
}
201201
}

crates/vm/src/builtins/set.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ impl PySet {
593593
self.inner.isdisjoint(other, vm)
594594
}
595595

596-
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyArithmeticValue<Self>> {
596+
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyArithmeticValue<Self>> {
597597
if let Ok(other) = AnySet::try_from_object(vm, other) {
598598
Ok(PyArithmeticValue::Implemented(self.op(
599599
other,
@@ -605,7 +605,7 @@ impl PySet {
605605
}
606606
}
607607

608-
fn __and__(
608+
fn __and__(
609609
&self,
610610
other: PyObjectRef,
611611
vm: &VirtualMachine,
@@ -621,7 +621,7 @@ impl PySet {
621621
}
622622
}
623623

624-
fn __sub__(
624+
fn __sub__(
625625
&self,
626626
other: PyObjectRef,
627627
vm: &VirtualMachine,
@@ -637,7 +637,7 @@ impl PySet {
637637
}
638638
}
639639

640-
fn __rsub__(
640+
fn __rsub__(
641641
zelf: PyRef<Self>,
642642
other: PyObjectRef,
643643
vm: &VirtualMachine,
@@ -653,7 +653,7 @@ impl PySet {
653653
}
654654
}
655655

656-
fn __xor__(
656+
fn __xor__(
657657
&self,
658658
other: PyObjectRef,
659659
vm: &VirtualMachine,
@@ -696,7 +696,7 @@ impl PySet {
696696
self.inner.pop(vm)
697697
}
698698

699-
fn __ior__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
699+
fn __ior__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
700700
zelf.inner.update(set.into_iterable_iter(vm)?, vm)?;
701701
Ok(zelf)
702702
}
@@ -719,7 +719,7 @@ impl PySet {
719719
Ok(())
720720
}
721721

722-
fn __iand__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
722+
fn __iand__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
723723
zelf.inner
724724
.intersection_update(std::iter::once(set.into_iterable(vm)?), vm)?;
725725
Ok(zelf)
@@ -731,7 +731,7 @@ impl PySet {
731731
Ok(())
732732
}
733733

734-
fn __isub__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
734+
fn __isub__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
735735
zelf.inner
736736
.difference_update(set.into_iterable_iter(vm)?, vm)?;
737737
Ok(zelf)
@@ -748,7 +748,7 @@ impl PySet {
748748
Ok(())
749749
}
750750

751-
fn __ixor__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
751+
fn __ixor__(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
752752
zelf.inner
753753
.symmetric_difference_update(set.into_iterable_iter(vm)?, vm)?;
754754
Ok(zelf)
@@ -1026,7 +1026,7 @@ impl PyFrozenSet {
10261026
self.inner.isdisjoint(other, vm)
10271027
}
10281028

1029-
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyArithmeticValue<Self>> {
1029+
fn __or__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyArithmeticValue<Self>> {
10301030
if let Ok(set) = AnySet::try_from_object(vm, other) {
10311031
Ok(PyArithmeticValue::Implemented(self.op(
10321032
set,
@@ -1038,7 +1038,7 @@ impl PyFrozenSet {
10381038
}
10391039
}
10401040

1041-
fn __and__(
1041+
fn __and__(
10421042
&self,
10431043
other: PyObjectRef,
10441044
vm: &VirtualMachine,
@@ -1054,7 +1054,7 @@ impl PyFrozenSet {
10541054
}
10551055
}
10561056

1057-
fn __sub__(
1057+
fn __sub__(
10581058
&self,
10591059
other: PyObjectRef,
10601060
vm: &VirtualMachine,
@@ -1070,7 +1070,7 @@ impl PyFrozenSet {
10701070
}
10711071
}
10721072

1073-
fn __rsub__(
1073+
fn __rsub__(
10741074
zelf: PyRef<Self>,
10751075
other: PyObjectRef,
10761076
vm: &VirtualMachine,
@@ -1087,7 +1087,7 @@ impl PyFrozenSet {
10871087
}
10881088
}
10891089

1090-
fn __xor__(
1090+
fn __xor__(
10911091
&self,
10921092
other: PyObjectRef,
10931093
vm: &VirtualMachine,

crates/vm/src/builtins/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl Py<PyStr> {
540540
)
541541
)]
542542
impl PyStr {
543-
fn __add__(zelf: PyRef<Self>, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
543+
fn __add__(zelf: PyRef<Self>, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
544544
if let Some(other) = other.downcast_ref::<Self>() {
545545
let bytes = zelf.as_wtf8().py_add(other.as_wtf8());
546546
Ok(unsafe {
@@ -634,7 +634,7 @@ impl PyStr {
634634
std::mem::size_of::<Self>() + self.byte_len() * std::mem::size_of::<u8>()
635635
}
636636

637-
fn __mul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
637+
fn __mul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
638638
Self::repeat(zelf, value.into(), vm)
639639
}
640640

@@ -948,7 +948,7 @@ impl PyStr {
948948
cformat_string(vm, self.as_wtf8(), values)
949949
}
950950

951-
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
951+
fn __rmod__(&self, _values: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
952952
vm.ctx.not_implemented()
953953
}
954954

crates/vm/src/builtins/tuple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl<T> PyTuple<PyRef<T>> {
262262
with(AsMapping, AsSequence, Hashable, Comparable, Iterable, Constructor, Representable)
263263
)]
264264
impl PyTuple {
265-
fn __add__(
265+
fn __add__(
266266
zelf: PyRef<Self>,
267267
other: PyObjectRef,
268268
vm: &VirtualMachine,
@@ -306,7 +306,7 @@ impl PyTuple {
306306
self.elements.len()
307307
}
308308

309-
fn __mul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
309+
fn __mul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
310310
Self::repeat(zelf, value.into(), vm)
311311
}
312312

0 commit comments

Comments
 (0)