sync-code
Synchronize code blocks between different files.
It can replace macros in certain scenarios. For example, when your code isn’t duplicated many times but the design is relatively complex (e.g., involving generics), using sync-code instead of a macro will give you much better readability and easier maintenance. Features like Go-to-definition and intelligent auto-completion also work properly without using macros.
Usage
Cargo.toml:
cargo add --build sync-code
See crate.
build.rs:
your_code.rs:
// $sync block_name
// $sync end
See also tests