We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a50ca74 commit 4d244f0Copy full SHA for 4d244f0
vm/src/builtins/int.rs
@@ -589,12 +589,9 @@ impl PyInt {
589
590
#[pymethod(magic)]
591
fn format(&self, spec: PyStrRef, vm: &VirtualMachine) -> PyResult<String> {
592
- match FormatSpec::parse(spec.as_str())
+ FormatSpec::parse(spec.as_str())
593
.and_then(|format_spec| format_spec.format_int(&self.value))
594
- {
595
- Ok(string) => Ok(string),
596
- Err(err) => Err(vm.new_value_error(err.to_string())),
597
- }
+ .map_err(|msg| vm.new_value_error(msg.to_owned()))
598
}
599
600
0 commit comments