diff --git a/crates/component-macro/src/bindgen.rs b/crates/component-macro/src/bindgen.rs index 9636c7f342b8..8d3d49f2db02 100644 --- a/crates/component-macro/src/bindgen.rs +++ b/crates/component-macro/src/bindgen.rs @@ -58,13 +58,16 @@ pub fn expand(input: &Config) -> Result { } let mut contents = src.parse::().unwrap(); - // Include a dummy `include_str!` for any files we read so rustc knows that + // Include a dummy `include_bytes!` for any files we read so rustc knows that // we depend on the contents of those files. for file in input.files.iter() { contents.extend( - format!("const _: &str = include_str!(r#\"{}\"#);\n", file.display()) - .parse::() - .unwrap(), + format!( + "const _: &[u8] = include_bytes!(r#\"{}\"#);\n", + file.display() + ) + .parse::() + .unwrap(), ); }