inline_tweak
inline_tweak is based on this blogpost by tuxedo labs.
Tweak any number literal directly from your code, changes to the source appear while running the program.
It works by parsing the file when a change occurs.
The library is minimal, only requiring the lazy_static
dependency to hold modified values.
In release mode, the tweaking code is disabled and compiled away.
Usage
use *;
Extra features
watch!
inline_tweak
provides a watch!()
macro that sleeps until the file is modified, akin to a breakpoint:
use *;
Expressions
inline_tweak
allows to tweak expressions by providing a value later.
For example:
tweak!
can then be replaced by a constant value by modifying the file (even while the application is running) to
tweak! // will always return 5.0
See the "expression" example in action
Installation
Simply add this line to your Cargo.toml
= "1.0.6"