#load #fs #debugging #mode #content #binary #embed

embed-file

Embeds files content into the binary in release mode, but loads it from the fs in debug

2 unstable releases

0.2.0 Nov 9, 2024
0.1.0 Jun 6, 2023

#12 in #debug

Download history 18/week @ 2024-08-05 4/week @ 2024-08-12 15/week @ 2024-08-19 10/week @ 2024-08-26 1/week @ 2024-09-02 28/week @ 2024-09-09 37/week @ 2024-09-16 3/week @ 2024-09-23 102/week @ 2024-11-04 18/week @ 2024-11-11 7/week @ 2024-11-18

127 downloads per month

MIT license

7KB
68 lines

License Crates.io Docs.rs

embed-file

A simplified version of rust-embed for single files instead of folders. Embeds files content into the binary in release mode, but loads it from the fs in debug.

The goal of is to avoid unnecessary recompilations when an included by e.g. include_str file change.

Usage

let my_string = embed_file::embed_string!("path/to/my-text.txt");
let my_image = embed_file::embed_bytes!("path/to/my-image.jpg");

Contributing

  • please run .pre-commit.sh before sending a PR, it will check everything

License

This project is licensed under the MIT license.

No runtime deps