-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from Wulf/wulf/custom-crate-path
Allow users to specify a custom path to the rust_embed crate in generated code
- Loading branch information
Showing
3 changed files
with
60 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// This test checks that the `crate_path` attribute can be used | ||
/// to specify a custom path to the `rust_embed` crate. | ||
|
||
mod custom { | ||
pub mod path { | ||
pub use rust_embed; | ||
} | ||
} | ||
|
||
// We introduce a 'rust_embed' module here to break compilation in case | ||
// the `rust_embed` crate is not loaded correctly. | ||
// | ||
// To test this, try commenting out the attribute which specifies the | ||
// the custom crate path -- you should find that the test fails to compile. | ||
mod rust_embed {} | ||
|
||
#[derive(custom::path::rust_embed::RustEmbed)] | ||
#[crate_path = "custom::path::rust_embed"] | ||
#[folder = "examples/public/"] | ||
struct Asset; |