mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
3 files changed
+6
-6
No files matched your search
@@ -220,8 +220,8 @@ jobs:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
components: rustfmt
|
||||
toolchain: nightly
|
||||
components: rustfmt, clippy
|
||||
override: true
|
||||
- name: run rustfmt
|
||||
uses: actions-rs/cargo@v1
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ mod zlib {
|
||||
fn header_from_wbits(wbits: OptionalArg<i8>, vm: &VirtualMachine) -> PyResult<InitOptions> {
|
||||
let wbits = wbits.unwrap_or(MAX_WBITS as i8);
|
||||
let header = wbits > 0;
|
||||
let wbits = wbits.abs() as u8;
|
||||
let wbits = wbits.unsigned_abs();
|
||||
match wbits {
|
||||
9..=15 => Ok(InitOptions::Standard {
|
||||
header,
|
||||
|
||||
+3
-3
@@ -599,8 +599,8 @@ fn try_update_quantity_from_tuple<'a, I: Iterator<Item = &'a PyObjectRef>>(
|
||||
Some(CFormatQuantity::FromValuesTuple) => match elements.next() {
|
||||
Some(width_obj) => {
|
||||
if let Some(i) = width_obj.payload::<PyInt>() {
|
||||
let i = i.try_to_primitive::<i32>(vm)?.abs() as usize;
|
||||
*q = Some(CFormatQuantity::Amount(i));
|
||||
let i = i.try_to_primitive::<i32>(vm)?.unsigned_abs();
|
||||
*q = Some(CFormatQuantity::Amount(i as usize));
|
||||
Ok(())
|
||||
} else {
|
||||
Err(vm.new_type_error("* wants int".to_owned()))
|
||||
@@ -953,7 +953,7 @@ where
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Ok(Some(CFormatQuantity::Amount(num.abs() as usize)));
|
||||
return Ok(Some(CFormatQuantity::Amount(num.unsigned_abs() as usize)));
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
|
||||
Reference in new issue
Block a user