forked from Rust-related/RustPython
Update format to Rust version 1.39
This commit is contained in:
@@ -1389,7 +1389,9 @@ fn try_update_quantity_from_tuple(
|
||||
Ok(tuple_index)
|
||||
}
|
||||
}
|
||||
None => Err(vm.new_type_error("not enough arguments for format string".to_string())),
|
||||
None => {
|
||||
Err(vm.new_type_error("not enough arguments for format string".to_string()))
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => Ok(tuple_index),
|
||||
|
||||
@@ -625,8 +625,12 @@ fn comprehension_to_ast(
|
||||
|
||||
fn string_to_ast(vm: &VirtualMachine, string: &ast::StringGroup) -> PyResult<AstNodeRef> {
|
||||
let string = match string {
|
||||
ast::StringGroup::Constant { value } => node!(vm, Str, { s => vm.ctx.new_str(value.clone()) }),
|
||||
ast::StringGroup::FormattedValue { value, .. } => node!(vm, FormattedValue, { value => expression_to_ast(vm, value)? }),
|
||||
ast::StringGroup::Constant { value } => {
|
||||
node!(vm, Str, { s => vm.ctx.new_str(value.clone()) })
|
||||
}
|
||||
ast::StringGroup::FormattedValue { value, .. } => {
|
||||
node!(vm, FormattedValue, { value => expression_to_ast(vm, value)? })
|
||||
}
|
||||
ast::StringGroup::Joined { values } => {
|
||||
let py_values = map_ast(string_to_ast, vm, &values)?;
|
||||
node!(vm, JoinedStr, { values => py_values })
|
||||
|
||||
@@ -54,7 +54,9 @@ fn name(
|
||||
} else {
|
||||
match default {
|
||||
OptionalArg::Present(obj) => Ok(obj),
|
||||
OptionalArg::Missing => Err(vm.new_value_error("character name not found!".to_string())),
|
||||
OptionalArg::Missing => {
|
||||
Err(vm.new_value_error("character name not found!".to_string()))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user