File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 55/// ```should_panic
66/// use assert_cmd::Command;
77///
8- /// let mut cmd = Command::cargo_bin(assert_cmd::crate_name !()).unwrap();
8+ /// let mut cmd = Command::cargo_bin(assert_cmd::pkg_name !()).unwrap();
99/// let assert = cmd
1010/// .arg("-A")
1111/// .env("stdout", "hello")
1818/// .stdout("hello\n");
1919/// ```
2020#[ macro_export]
21+ macro_rules! pkg_name {
22+ ( ) => {
23+ env!( "CARGO_PKG_NAME" )
24+ } ;
25+ }
26+
27+ /// Deprecated, replaced with [`pkg_name`]
28+ #[ deprecated( since = "2.1.0" , note = "replaced with `pkg_name!`" ) ]
29+ #[ macro_export]
2130macro_rules! crate_name {
2231 ( ) => {
2332 env!( "CARGO_PKG_NAME" )
@@ -45,7 +54,7 @@ macro_rules! crate_name {
4554#[ doc( hidden) ]
4655macro_rules! cargo_bin {
4756 ( ) => {
48- $crate:: cargo:: cargo_bin!( $crate:: crate_name !( ) )
57+ $crate:: cargo:: cargo_bin!( $crate:: pkg_name !( ) )
4958 } ;
5059 ( $bin_target_name: expr) => {
5160 :: std:: path:: Path :: new( env!( concat!( "CARGO_BIN_EXE_" , $bin_target_name) ) )
You can’t perform that action at this time.
0 commit comments