use ::core instead of $crate in option_env!

This commit is contained in:
hkalbasi 2023-05-25 18:46:34 +03:30
parent 21e5dc2af9
commit b0f17668f7
3 changed files with 23 additions and 10 deletions

View file

@ -820,10 +820,10 @@ fn option_env_expand(
)
}
};
// FIXME: Use `DOLLAR_CRATE` when that works in eager macros.
let expanded = match get_env_inner(db, arg_id, &key) {
None => quote! { #DOLLAR_CRATE::option::Option::None::<&str> },
Some(s) => quote! { #DOLLAR_CRATE::option::Option::Some(#s) },
None => quote! { ::core::option::Option::None::<&str> },
Some(s) => quote! { ::core::option::Option::Some(#s) },
};
ExpandResult::ok(ExpandedEager::new(expanded))