mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Simplify error formatting of str.__mod__ method.
This commit is contained in:
@@ -514,7 +514,7 @@ impl PyString {
|
||||
fn modulo(&self, values: PyObjectRef, vm: &VirtualMachine) -> PyResult {
|
||||
let format_string_text = &self.value;
|
||||
let format_string = CFormatString::from_str(format_string_text)
|
||||
.map_err(|err| vm.new_value_error(format!("{}", err)))?;
|
||||
.map_err(|err| vm.new_value_error(err.to_string()))?;
|
||||
do_cformat(vm, format_string, values.clone())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user