Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions derive/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl ItemMetaInner {
ident,
format!(
"#[{meta_ident}({name})] is not one of allowed attributes [{}]",
allowed_names.join(", ")
allowed_names.join(", "), name=name, meta_ident=meta_ident
),
))
}
Expand All @@ -114,7 +114,7 @@ impl ItemMetaInner {
if !lits.is_empty() {
return Err(syn::Error::new_spanned(
&meta_ident,
format!("#[{meta_ident}(..)] cannot contain literal"),
format!("#[{meta_ident}(..)] cannot contain literal", meta_ident=meta_ident),
));
}

Expand Down
8 changes: 4 additions & 4 deletions vm/src/codecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ fn namereplace_errors(err: PyObjectRef, vm: &VirtualMachine) -> PyResult<(String
use std::fmt::Write;
let c_u32 = c as u32;
if let Some(c_name) = unicode_names2::name(c) {
write!(out, "\\N{{{c_name}}}").unwrap();
write!(out, "\\N{{{c_name}}}", c_name=c_name).unwrap();
} else if c_u32 >= 0x10000 {
write!(out, "\\U{c_u32:08x}").unwrap();
write!(out, "\\U{c_u32:08x}", c_u32=c_u32).unwrap();
} else if c_u32 >= 0x100 {
write!(out, "\\u{c_u32:04x}").unwrap();
write!(out, "\\u{c_u32:04x}", c_u32=c_u32).unwrap();
} else {
write!(out, "\\x{c_u32:02x}").unwrap();
write!(out, "\\x{c_u32:02x}", c_u32=c_u32).unwrap();
}
}
Ok((out, range.end))
Expand Down
2 changes: 1 addition & 1 deletion vm/src/exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl VirtualMachine {
}?;

match offer_suggestions(exc, vm) {
Some(suggestions) => writeln!(output, ". Did you mean: '{suggestions}'?"),
Some(suggestions) => writeln!(output, ". Did you mean: '{suggestions}'?", suggestions=suggestions),
None => writeln!(output),
}
}
Expand Down
2 changes: 1 addition & 1 deletion vm/src/pyobjectrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ fn print_del_error(e: PyBaseExceptionRef, zelf: &PyObject, vm: &VirtualMachine)
let del_method = zelf.get_class_attr("__del__").unwrap();
let repr = &del_method.repr(vm);
match repr {
Ok(v) => println!("{v}"),
Ok(v) => println!("{v}",v=v),
Err(_) => println!("{}", del_method.class().name()),
}
let tb_module = vm.import("traceback", None, 0).unwrap();
Expand Down