Update format to Rust version 1.39

This commit is contained in:
Aviv Palivoda
2019-11-08 23:03:24 +02:00
parent b1b028e4bd
commit aebc0a42d8
3 changed files with 12 additions and 4 deletions

View File

@@ -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),

View File

@@ -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 })

View File

@@ -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()))
}
}
}
}