Skip to content

Commit 790b29a

Browse files
committed
rework SchedParam
1 parent ac1559f commit 790b29a

File tree

3 files changed

+167
-213
lines changed

3 files changed

+167
-213
lines changed

crates/stdlib/src/socket.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,9 +2206,9 @@ mod _socket {
22062206
Some(t) => {
22072207
let f = t.into_float();
22082208
if f.is_nan() {
2209-
return Err(vm.new_value_error(
2210-
"Invalid value NaN (not a number)".to_owned(),
2211-
));
2209+
return Err(
2210+
vm.new_value_error("Invalid value NaN (not a number)".to_owned())
2211+
);
22122212
}
22132213
if f < 0.0 || !f.is_finite() {
22142214
return Err(vm.new_value_error("Timeout value out of range".to_owned()));
@@ -3388,9 +3388,7 @@ mod _socket {
33883388
Some(t) => {
33893389
let f = t.into_float();
33903390
if f.is_nan() {
3391-
return Err(vm.new_value_error(
3392-
"Invalid value NaN (not a number)".to_owned(),
3393-
));
3391+
return Err(vm.new_value_error("Invalid value NaN (not a number)".to_owned()));
33943392
}
33953393
if f < 0.0 || !f.is_finite() {
33963394
return Err(vm.new_value_error("Timeout value out of range".to_owned()));

crates/vm/src/convert/try_from.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ impl TryFromObject for core::time::Duration {
127127
if let Some(float) = obj.downcast_ref::<PyFloat>() {
128128
let f = float.to_f64();
129129
if f.is_nan() {
130-
return Err(
131-
vm.new_value_error("Invalid value NaN (not a number)".to_owned())
132-
);
130+
return Err(vm.new_value_error("Invalid value NaN (not a number)".to_owned()));
133131
}
134132
if f < 0.0 {
135133
return Err(vm.new_value_error("negative duration".to_owned()));

0 commit comments

Comments
 (0)