https://github.com/milesq/include-url
Include Rust code from given URL
https://github.com/milesq/include-url
proc-macro rust
Last synced: 6 months ago
JSON representation
Include Rust code from given URL
- Host: GitHub
- URL: https://github.com/milesq/include-url
- Owner: Milesq
- Created: 2021-01-01T21:52:41.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-28T18:16:47.000Z (about 4 years ago)
- Last Synced: 2025-08-16T07:33:10.734Z (6 months ago)
- Topics: proc-macro, rust
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# include-url
This crate provides `include_url` macro, which works like `include_str` from `std` with 2 differences
- Data is taken from URL, not local files
- The data from given URL is treated as a Rust code, rather than raw data
## Examples
```rs
use include_url::include_raw_url;
include_raw_url!("https://raw.githubusercontent.com/Milesq/include-url/main/assets/add.rs");
fn main() {
println!("{}", add(2, 3)); // prints 5
}
```