Seven-Streams commented on code in PR #682:
URL: https://github.com/apache/tvm-ffi/pull/682#discussion_r3634994364


##########
rust/tvm-ffi-macros/src/utils.rs:
##########
@@ -20,10 +20,11 @@ use proc_macro2::TokenStream;
 use quote::quote;
 use std::env;
 
-/// Get the tvm-rt crate name
-/// \return The tvm-rt crate name
+/// Return the path used to reference the `tvm-ffi` crate in generated code.
 pub(crate) fn get_tvm_ffi_crate() -> TokenStream {
-    if env::var("CARGO_PKG_NAME").unwrap() == "tvm-ffi" {
+    let is_tvm_ffi = env::var("CARGO_PKG_NAME").ok().as_deref() == 
Some("tvm-ffi")
+        && env::var("CARGO_CRATE_NAME").ok().as_deref() == Some("tvm_ffi");

Review Comment:
   can we use env::var("CARGO_CRATE_NAME").unwrap()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to