stub! - a better todo!
stub!() can be assigned to a variable:
let username = stub!;
This allows you to specify just type of the variable and continue working on other code, then come back later and specify its value.
Examples
Behavior
When a stub is invoked, it will panic like a todo!() macro.
However, unlike a todo!() macro, it will not make the subsequent parts of your code unreachable.
If a custom message is provided, it will be included in the panic message.
Notes
- The
stub!()macro is intended for use during development and should be replaced with actual implementations before production use. - When using
impl Traitin return position, you must useimpl dyn Traitin the macro invocation due to a limitation inmacro_rules!
Installation
cargo add stub-macro
Gratitude
Like the project? ⭐ Star this repo on GitHub!
License
Apache License 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.