Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sahandevs/ctc
Compile time configs for rust
https://github.com/sahandevs/ctc
Last synced: about 11 hours ago
JSON representation
Compile time configs for rust
- Host: GitHub
- URL: https://github.com/sahandevs/ctc
- Owner: sahandevs
- License: mit
- Created: 2021-12-09T19:22:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-21T12:26:44.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T12:21:35.457Z (29 days ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CTC - Compile-Time-Config
![Crates.io](https://img.shields.io/crates/v/ctc)
load config files on compile time.
## Usage
- 1: add dependencies
```toml
[dependencies]
ctc = "0.2"
```- 2: import config files like this:
```rust
ctc::import_conf!("Cargo.toml", cargo);fn main() {
println!("package.name: {}", cargo::package::name);
println!("package.version: {}", cargo::package::version);
println!("package.edition: {}", cargo::package::edition);
}
```See the [example project](./example).