mirror of
https://github.com/RGBCube/embd-rs
synced 2025-08-02 16:37:46 +00:00
Compare commits
4 commits
d61798c7e0
...
3d45164562
Author | SHA1 | Date | |
---|---|---|---|
3d45164562 | |||
9ec0768a8e | |||
601d4fed5f | |||
a4724700b2 |
10 changed files with 79 additions and 230 deletions
|
@ -1,2 +1,2 @@
|
||||||
[build]
|
[build]
|
||||||
rustflags = [ "--cfg", "procmacro2_semver_exempt" ]
|
rustflags = ["--cfg", "procmacro2_semver_exempt"]
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
condense_wildcard_suffixes = true
|
condense_wildcard_suffixes = true
|
||||||
|
max_width = 120
|
||||||
enum_discrim_align_threshold = 25
|
enum_discrim_align_threshold = 25
|
||||||
force_explicit_abi = false
|
force_explicit_abi = false
|
||||||
force_multiline_blocks = true
|
force_multiline_blocks = true
|
||||||
format_code_in_doc_comments = true
|
format_code_in_doc_comments = true
|
||||||
format_macro_matchers = true
|
format_macro_matchers = true
|
||||||
format_strings = true
|
format_strings = true
|
||||||
group_imports = "StdExternalCrate"
|
group_imports = "StdExternalCrate"
|
||||||
hex_literal_case = "Upper"
|
hex_literal_case = "Upper"
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Crate"
|
||||||
imports_layout = "Vertical"
|
imports_layout = "Vertical"
|
||||||
match_block_trailing_comma = true
|
match_block_trailing_comma = true
|
||||||
newline_style = "Unix"
|
newline_style = "Unix"
|
||||||
normalize_comments = true
|
normalize_comments = true
|
||||||
normalize_doc_attributes = true
|
normalize_doc_attributes = true
|
||||||
reorder_impl_items = true
|
reorder_impl_items = true
|
||||||
unstable_features = true
|
unstable_features = true
|
||||||
use_try_shorthand = true
|
use_try_shorthand = true
|
||||||
wrap_comments = true
|
wrap_comments = true
|
||||||
|
|
28
Cargo.lock
generated
28
Cargo.lock
generated
|
@ -1,19 +1,19 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embd"
|
name = "embd"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"embd-macros 0.1.1",
|
"embd-macros 0.1.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embd-macros"
|
name = "embd-macros"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6d8aff0b18a634834d77cf70effb2ee3f5ab2b4f36f1caa7fabe213ac7767b0f"
|
checksum = "ad70201855c78504fbd460954eb86c33c8ed9262f3514ea3b6a55162fc231a24"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -22,7 +22,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embd-macros"
|
name = "embd-macros"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -31,27 +31,27 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.83"
|
version = "1.0.93"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43"
|
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.36"
|
version = "1.0.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.65"
|
version = "2.0.98"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106"
|
checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -60,6 +60,6 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.12"
|
version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [ "embd", "embd-macros" ]
|
members = ["embd", "embd-macros"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
[package]
|
[package]
|
||||||
name = "embd-macros"
|
name = "embd-macros"
|
||||||
description = "Read files or directories from the filesystem at runtime on debug, embed on release."
|
description = "Read files or directories from the filesystem at runtime on debug, embed on release."
|
||||||
repository = "https://github.com/RGBCube/embd-rs"
|
repository = "https://github.com/RGBCube/embd-rs"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
keywords = [ "embedding", "files", "debug-optimization", "bundling" ]
|
keywords = ["embedding", "files", "debug-optimization", "bundling"]
|
||||||
categories = [ "filesystem" ]
|
categories = ["filesystem"]
|
||||||
authors = [ "RGBCube" ]
|
authors = ["RGBCube"]
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
include = [ "src/**/*.rs", "README.md" ]
|
include = ["src/**/*.rs", "../README.md"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustc-args = [ "--cfg", "procmacro2_semver_exempt" ]
|
rustc-args = ["--cfg", "procmacro2_semver_exempt"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
proc-macro2 = { version = "1", features = [ "span-locations" ] }
|
proc-macro2 = { version = "1", features = ["span-locations"] }
|
||||||
quote = "1"
|
quote = "1"
|
||||||
syn = "2"
|
syn = "2"
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
# embd-rs
|
|
||||||
|
|
||||||
A super simple file and directory embedding crate,
|
|
||||||
that loads files from the filesystem on debug mode,
|
|
||||||
allowing for quick edit-and-test cycles without compilation.
|
|
||||||
|
|
||||||
It is also super efficient, and does not heap allocate when the
|
|
||||||
files are embedded on release mode by utilizing `std::borrow::Cow`.
|
|
||||||
|
|
||||||
On release mode it falls back to `include_str!`, `include_bytes!`
|
|
||||||
and our own custom `include_dir!`-like implementation.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add this to your Cargo.toml:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
embd = "0.1"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can use this crate like so:
|
|
||||||
|
|
||||||
```rs
|
|
||||||
let contents: Cow<'_, str> = embd::string!("path/to/file.txt");
|
|
||||||
let bytes: Cow<'_, [u8]> = embd::bytes!("path/to/image.png");
|
|
||||||
|
|
||||||
let dir: embd::Dir = embd::dir!("path/to");
|
|
||||||
let files: Vec<embd::File> = dir.flatten();
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you will need to enable the `procmacro2_semver_exempt` cfg
|
|
||||||
option to use this crate, you can enable it like so, by putting this in
|
|
||||||
`.cargo/config.toml` in the project root:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[build]
|
|
||||||
rustflags = [ "--cfg", "procmacro2_semver_exempt" ]
|
|
||||||
```
|
|
||||||
|
|
||||||
## To-Do
|
|
||||||
|
|
||||||
- [ ] Hot reloading of files in debug mode.
|
|
||||||
- [ ] Don't depend on `procmacro2_semver_exempt`.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
```
|
|
||||||
Copyright (c) 2023-present RGBCube
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
```
|
|
|
@ -74,14 +74,11 @@ fn dir_debug(path: &str) -> TokenStream {
|
||||||
|
|
||||||
#[cfg(procmacro2_semver_exempt)]
|
#[cfg(procmacro2_semver_exempt)]
|
||||||
fn dir_release(input: TokenStream, path: &str) -> TokenStream {
|
fn dir_release(input: TokenStream, path: &str) -> TokenStream {
|
||||||
let neighbor = TokenStream::from(input).span().source_file().path();
|
let neighbor = input.span().source_file().path();
|
||||||
|
|
||||||
let base = neighbor.parent().expect("Failed to get the parent of file");
|
let base = neighbor.parent().expect("Failed to get the parent of file");
|
||||||
|
|
||||||
let directory = base
|
let directory = base.join(path).canonicalize().expect("Failed to canonicalize path");
|
||||||
.join(path)
|
|
||||||
.canonicalize()
|
|
||||||
.expect("Failed to canonicalize path");
|
|
||||||
|
|
||||||
let directory_str = directory.to_str().expect("Failed to convert OsStr to str");
|
let directory_str = directory.to_str().expect("Failed to convert OsStr to str");
|
||||||
|
|
||||||
|
@ -108,9 +105,7 @@ fn read_dir(directory: &Path) -> TokenVec {
|
||||||
.to_str()
|
.to_str()
|
||||||
.expect("Failed to get the string representation of PathBuf");
|
.expect("Failed to get the string representation of PathBuf");
|
||||||
|
|
||||||
let filetype = fs::metadata(&path)
|
let filetype = fs::metadata(&path).expect("Failed to get file metadata").file_type();
|
||||||
.expect("Failed to get file metadata")
|
|
||||||
.file_type();
|
|
||||||
|
|
||||||
if filetype.is_dir() {
|
if filetype.is_dir() {
|
||||||
let children = read_dir(&path);
|
let children = read_dir(&path);
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
[package]
|
[package]
|
||||||
name = "embd"
|
name = "embd"
|
||||||
description = "Read files or directories from the filesystem at runtime on debug, embed on release."
|
description = "Read files or directories from the filesystem at runtime on debug, embed on release."
|
||||||
repository = "https://github.com/RGBCube/embd-rs"
|
repository = "https://github.com/RGBCube/embd-rs"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
keywords = [ "embedding", "files", "debug-optimization", "bundling" ]
|
keywords = ["embedding", "files", "debug-optimization", "bundling"]
|
||||||
categories = [ "filesystem" ]
|
categories = ["filesystem"]
|
||||||
authors = [ "RGBCube" ]
|
authors = ["RGBCube"]
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
include = [ "src/**/*.rs", "README.md" ]
|
include = ["src/**/*.rs", "../README.md"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustc-args = [ "--cfg", "procmacro2_semver_exempt" ]
|
rustc-args = ["--cfg", "procmacro2_semver_exempt"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embd-macros = "0.1"
|
embd-macros = "0.1"
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
# embd-rs
|
|
||||||
|
|
||||||
A super simple file and directory embedding crate,
|
|
||||||
that loads files from the filesystem on debug mode,
|
|
||||||
allowing for quick edit-and-test cycles without compilation.
|
|
||||||
|
|
||||||
It is also super efficient, and does not heap allocate when the
|
|
||||||
files are embedded on release mode by utilizing `std::borrow::Cow`.
|
|
||||||
|
|
||||||
On release mode it falls back to `include_str!`, `include_bytes!`
|
|
||||||
and our own custom `include_dir!`-like implementation.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add this to your Cargo.toml:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
embd = "0.1"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can use this crate like so:
|
|
||||||
|
|
||||||
```rs
|
|
||||||
let contents: Cow<'_, str> = embd::string!("path/to/file.txt");
|
|
||||||
let bytes: Cow<'_, [u8]> = embd::bytes!("path/to/image.png");
|
|
||||||
|
|
||||||
let dir: embd::Dir = embd::dir!("path/to");
|
|
||||||
let files: Vec<embd::File> = dir.flatten();
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you will need to enable the `procmacro2_semver_exempt` cfg
|
|
||||||
option to use this crate, you can enable it like so, by putting this in
|
|
||||||
`.cargo/config.toml` in the project root:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[build]
|
|
||||||
rustflags = [ "--cfg", "procmacro2_semver_exempt" ]
|
|
||||||
```
|
|
||||||
|
|
||||||
## To-Do
|
|
||||||
|
|
||||||
- [ ] Hot reloading of files in debug mode.
|
|
||||||
- [ ] Don't depend on `procmacro2_semver_exempt`.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
```
|
|
||||||
Copyright (c) 2023-present RGBCube
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
```
|
|
|
@ -1,6 +1,8 @@
|
||||||
#![allow(unexpected_cfgs)]
|
#![allow(unexpected_cfgs)]
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
|
collections::VecDeque,
|
||||||
fs,
|
fs,
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
@ -31,9 +33,7 @@ pub fn __string_runtime(neighbor: &str, path: &str) -> String {
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// fn main() {
|
/// let content: Cow<'static, str> = embd::string!("main.rs");
|
||||||
/// let content: Cow<'static, str> = embd::string!("main.rs");
|
|
||||||
/// }
|
|
||||||
/// ```
|
/// ```
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[cfg(procmacro2_semver_exempt)]
|
#[cfg(procmacro2_semver_exempt)]
|
||||||
|
@ -66,10 +66,8 @@ pub fn __bytes_runtime(neighbor: &str, path: &str) -> Vec<u8> {
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// fn main() {
|
/// // `assets/` is in the same directory as `src/`
|
||||||
/// // `assets/` is in the same directory as `src/`
|
/// let content: Cow<'static, [u8]> = embd::string!("../assets/icon.png");
|
||||||
/// let content: Cow<'static, [u8]> = embd::string!("../assets/icon.png");
|
|
||||||
/// }
|
|
||||||
/// ```
|
/// ```
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[cfg(procmacro2_semver_exempt)]
|
#[cfg(procmacro2_semver_exempt)]
|
||||||
|
@ -128,17 +126,19 @@ impl Dir {
|
||||||
|
|
||||||
/// Collects all files from the directory into a vector.
|
/// Collects all files from the directory into a vector.
|
||||||
pub fn flatten(self) -> Vec<File> {
|
pub fn flatten(self) -> Vec<File> {
|
||||||
let mut entries = Vec::new();
|
let mut files = Vec::new();
|
||||||
|
let mut dirs = VecDeque::from([self]);
|
||||||
|
|
||||||
for child in self.__children.into_owned() {
|
while let Some(dir) = dirs.pop_front() {
|
||||||
// TODO: Eliminate allocation.
|
for child in dir.__children.iter().cloned() {
|
||||||
match child {
|
match child {
|
||||||
DirEntry::File(file) => entries.push(file),
|
DirEntry::File(file) => files.push(file),
|
||||||
DirEntry::Dir(dir) => entries.append(&mut dir.flatten()),
|
DirEntry::Dir(dir) => dirs.push_back(dir),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entries
|
files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,15 +171,9 @@ fn read_dir(directory: &Path) -> Vec<DirEntry> {
|
||||||
|
|
||||||
let filetype = entry.file_type().expect("Failed to read entry filetype");
|
let filetype = entry.file_type().expect("Failed to read entry filetype");
|
||||||
|
|
||||||
let path = entry
|
let path = entry.path().canonicalize().expect("Failed to canonicalize path");
|
||||||
.path()
|
|
||||||
.canonicalize()
|
|
||||||
.expect("Failed to canonicalize path");
|
|
||||||
|
|
||||||
let path_str = path
|
let path_str = path.to_str().expect("Failed to convert OsStr to str").to_string();
|
||||||
.to_str()
|
|
||||||
.expect("Failed to convert OsStr to str")
|
|
||||||
.to_string();
|
|
||||||
|
|
||||||
if filetype.is_dir() {
|
if filetype.is_dir() {
|
||||||
let children = read_dir(&path);
|
let children = read_dir(&path);
|
||||||
|
@ -210,10 +204,7 @@ pub fn __dir_runtime(neighbor: &str, path: &str) -> Dir {
|
||||||
.canonicalize()
|
.canonicalize()
|
||||||
.expect("Failed to canonicalize path");
|
.expect("Failed to canonicalize path");
|
||||||
|
|
||||||
let directory_str = directory
|
let directory_str = directory.to_str().expect("Failed to convert OsStr to str").to_string();
|
||||||
.to_str()
|
|
||||||
.expect("Failed to convert OsStr to str")
|
|
||||||
.to_string();
|
|
||||||
|
|
||||||
let children = read_dir(&directory);
|
let children = read_dir(&directory);
|
||||||
|
|
||||||
|
@ -230,9 +221,7 @@ pub fn __dir_runtime(neighbor: &str, path: &str) -> Dir {
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// fn main() {
|
/// let content: embd::Dir = embd::dir!("../assets");
|
||||||
/// let content: embd::Dir = embd::dir!("../assets");
|
|
||||||
/// }
|
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(procmacro2_semver_exempt)]
|
#[cfg(procmacro2_semver_exempt)]
|
||||||
pub use embd_macros::__dir as dir;
|
pub use embd_macros::__dir as dir;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue