Skip to content

Commit 37fd44d

Browse files
committed
Use 'new' format syntax.
1 parent 766d5f5 commit 37fd44d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

macros/src/embed_python.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl EmbedPython {
7878
} else {
7979
unreachable!()
8080
};
81-
let name_str = format!("_RUST_{}", name);
81+
let name_str = format!("_RUST_{name}");
8282
self.python.push_str(&name_str);
8383
self.column += name_str.chars().count() - 6 + 1;
8484
self.variables.entry(name_str).or_insert(name);
@@ -105,7 +105,7 @@ impl EmbedPython {
105105
}
106106
}
107107
TokenTree::Ident(x) => {
108-
write!(&mut self.python, "{}", x).unwrap();
108+
write!(&mut self.python, "{x}").unwrap();
109109
let end_span = token.span().end();
110110
self.line = end_span.line();
111111
self.column = end_span.column();

macros/src/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn ensure_libpython_symbols_loaded(py: Python) -> PyResult<()> {
1717
let sysconfig = py.import("sysconfig")?;
1818
let libdir: String = sysconfig.getattr("get_config_var")?.call1(("LIBDIR",))?.extract()?;
1919
let so_name: String = sysconfig.getattr("get_config_var")?.call1(("INSTSONAME",))?.extract()?;
20-
let path = std::ffi::CString::new(format!("{}/{}", libdir, so_name)).unwrap();
20+
let path = std::ffi::CString::new(format!("{libdir}/{so_name}")).unwrap();
2121
unsafe {
2222
libc::dlopen(path.as_ptr(), libc::RTLD_NOW | libc::RTLD_GLOBAL);
2323
}

0 commit comments

Comments
 (0)