Skip to content

Commit cffa18a

Browse files
committed
Fix format and remove custom, unreadable env var
1 parent 5f4456a commit cffa18a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

rustler_codegen/src/init.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,19 @@ impl From<InitMacroInput> for proc_macro2::TokenStream {
136136
}
137137
};
138138

139-
let lib_name = if let Ok(name) = std::env::var("RUSTLER_LIB_NAME") {
140-
name
141-
}
142-
else if let Ok(name) = std::env::var("CARGO_PKG_NAME") {
143-
if std::env::var("CARGO_TARGET_OS").unwrap_or_else(|_| "unknown".to_string()) == "windows" {
139+
let lib_name = if let Ok(name) = std::env::var("CARGO_PKG_NAME") {
140+
if std::env::var("CARGO_TARGET_OS").unwrap_or_else(|_| "unknown".to_string())
141+
== "windows"
142+
{
144143
name
145144
} else {
146-
format!("lib{}", name)
145+
format!("lib{name}")
147146
}
148147
} else {
149148
"rustler_pkg".to_string()
150149
};
151150

152-
let nif_init_name = format!("{}_nif_init", lib_name);
151+
let nif_init_name = format!("{lib_name}_nif_init");
153152
let nif_init_name = Ident::new(&nif_init_name, Span::call_site());
154153

155154
let bare_nif_inits = quote! {

0 commit comments

Comments
 (0)