spenserblack / request-include-rs

Request at compile time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

request-include

Build Status

I was experimenting to see if this was possible, but it's a very bad idea. Archiving.

include_str! from a request

This is basically just a shortcut to skip downloading a response, and using include_str! on that downloaded file.

Usage

use request_include::include_str as request_str;

// Without user agent
const DATA: &str = request_str!("API-url");

// With user agent (recommended)
const OTHER_DATA: &str = request_str!("API-url", "my user agent");

Warning

Use at your own risk. By requesting a value at compile-time, it is very possible that, with no changes to the code, the value assigned may change between compilations.

About

Request at compile time

License:Apache License 2.0


Languages

Language:Rust 100.0%