embed-file

Crates.ioembed-file
lib.rsembed-file
version0.2.0
sourcesrc
created_at2023-06-06 13:57:45.2775
updated_at2024-11-09 07:38:32.295728
descriptionEmbeds files content into the binary in release mode, but loads it from the fs in debug
homepage
repositoryhttps://github.com/imbolc/embed-file
max_upload_size
id883871
size10,892
Imbolc (imbolc)

documentation

README

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.

Commit count: 4

cargo fmt