mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Auto-format: cargo fmt --all
This commit is contained in:
1 parent
1740b083b8
commit
6f41a9491b
1 file changed
+8
-6
@@ -99,12 +99,14 @@ impl Initializer for PyNamespace {
|
||||
|
||||
// Validate keys are strings and set attributes
|
||||
for (key, value) in dict.into_iter() {
|
||||
let key_str = key.downcast_ref::<crate::builtins::PyStr>().ok_or_else(|| {
|
||||
vm.new_type_error(format!(
|
||||
"keywords must be strings, not '{}'",
|
||||
key.class().name()
|
||||
))
|
||||
})?;
|
||||
let key_str = key
|
||||
.downcast_ref::<crate::builtins::PyStr>()
|
||||
.ok_or_else(|| {
|
||||
vm.new_type_error(format!(
|
||||
"keywords must be strings, not '{}'",
|
||||
key.class().name()
|
||||
))
|
||||
})?;
|
||||
zelf.as_object().set_attr(key_str, value, vm)?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user