Skip to content

Commit 08e383d

Browse files
committed
Build -> Dev
Probably shouldn't force users to install ureq from a unit test..
1 parent e75e943 commit 08e383d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name = "constime"
33
authors = ["David Cruz <[email protected]>"]
44
repository = "https://github.com/DvvCz/Constime"
55
description = "Zig's comptime for Rust with zero dependencies. Mostly something to play around with until more stuff is const fn."
6-
version = "0.2.1"
6+
version = "0.2.2"
77
edition = "2021"
88
license = "MIT"
99

1010
[lib]
1111
proc-macro = true
1212
doctest = false
1313

14-
[build-dependencies]
14+
[dev-dependencies]
1515
ureq = "2.6.1"

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ This is a tiny alternative to <https://github.com/nhynes/comptime-rs>, with no d
77
cargo add constime
88
```
99

10-
Note that in order to use dependencies in `comptime!`, you must either:
11-
* Have it as a normal dependency in `[dependencies]`.
12-
* Have it as a build dependency in `[build-dependencies]`, alongside:
13-
* A `build.rs` file to make rust compiles the dependencies.
14-
* Explicitly importing the crate using `extern crate`.
10+
Dependencies in `comptime!` can be stored in either `[dependencies]` or `[build-dependencies]`, and must be explicitly imported using `extern crate`.
11+
12+
You will also need a build.rs file in order to force `[build-dependencies]` to compile.
1513

1614
## Example
1715

build.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![doc = include_str!("../README.md")]
2+
13
extern crate proc_macro;
24
use proc_macro::TokenStream;
35
use std::hash::{Hash, Hasher};
@@ -20,6 +22,7 @@ pub fn comptime(code: TokenStream) -> TokenStream {
2022
};
2123

2224
let code = format!("fn main(){{ println!(\"{{:?}}\", {{ {code} }}) }}");
25+
2326
let mut hash = std::collections::hash_map::DefaultHasher::new();
2427
code.hash(&mut hash);
2528
let hash = hash.finish();

0 commit comments

Comments
 (0)