File: metadata_only.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 (12 lines) | stat: -rw-r--r-- 285 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
use rust_embed::{Embed, EmbeddedFile};

#[derive(Embed)]
#[folder = "examples/public/"]
#[metadata_only = true]
struct Asset;

#[test]
fn file_is_empty() {
  let index_file: EmbeddedFile = Asset::get("index.html").expect("index.html exists");
  assert_eq!(index_file.data.len(), 0);
}