inline_tweak 1.0.3

Tweak values directly from the source code
Documentation
inline_tweak-1.0.3 has been yanked.

Inline tweak

Crates.io

Inline tweaks 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 inline_tweak::*;

fn main() {
    loop {
        println!("{}", tweak!(3.14)); // Try changing the value while the application is running
    }
}

inline_tweak also provides a watch!() macro that sleeps until the file is modified, akin to a breakpoint:

use inline_tweak::*;

fn main() {
    loop {
        println!("{}", tweak!(3.14));
        watch!(); // The thread will sleep here until anything in the file changes
    }
}

Installation

Simply add this line to your Cargo.toml

inline_tweak = "1.0.3"