-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to specify a custom path to the rust_embed crate in gener…
…ated code
- Loading branch information
Showing
2 changed files
with
55 additions
and
19 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
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; |