File: custom_crate_path.rs

package info (click to toggle)
rust-rust-embed 8.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,184 kB
  • sloc: javascript: 4; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;