diff --git a/README.md b/README.md index 7c45572..017854a 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ On release mode it falls back to `include_str!`, `include_bytes!` and `include_d ## Usage ```rs -let contents: String = embed::string!("path/to/file.txt"); -let bytes: Vec = embed::bytes!("path/to/image.png"); +let contents: Cow<'_, str> = embed::string!("path/to/file.txt"); +let bytes: Cow<'_, [u8]> = embed::bytes!("path/to/image.png"); ``` ## License diff --git a/src/file.rs b/src/file.rs index 3bf1e6b..b9b8a47 100644 --- a/src/file.rs +++ b/src/file.rs @@ -46,7 +46,7 @@ macro_rules! bytes { .expect("embed: file has no parent") .join($path); - Cow::<'static, str>::Owned(fs::read_to_string(&file).unwrap_or_else(|error| { + Cow::<'static, [u8]>::Owned(fs::read(&file).unwrap_or_else(|error| { panic!( "embed: failed to read file {file}: {error}", file = file.display()