Crates.io | dont-expand |
lib.rs | dont-expand |
version | 0.1.0 |
source | src |
created_at | 2021-10-29 23:09:20.120778 |
updated_at | 2021-10-29 23:09:20.120778 |
description | Dummy macros to shadow macros to avoid expansion in cargo expand |
homepage | |
repository | https://github.com/drewkett/dont-expand |
max_upload_size | |
id | 474219 |
size | 5,776 |
This library provides macro implementations for macros found in the rust std
library. The purpose of the macros in this library is to do nothing. The
macros are intended to be imported as needed to shadow the std macros. This
is useful when using cargo expand
to see what a macro might be doing as it
will effectively hide the typical expansion of the std macros which typically
just pollute the output.
Included macros are: assert, assert_eq, assert_ne, cfg, column, compile_error, concat, dbg, debug_assert, debug_assert_eq, debug_assert_ne, env, eprint, eprintln, file, format, format_args, include, include_bytes, include_str, is_x86_feature_detected, line, matches, module_path, option_env, panic, print, println, thread_local, todo, unimplemented, unreachable, vec, write, writeln
And the following derive macros: Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord
The following example would only show the expansion of the Default
macro
use dont_expand::{Debug, Clone};
#[derive(Debug, Clone, Default)]
struct Foo;
Glob imports don't work with dont-expand as that throws an error by the compiler since they shadow the std macros.