This commit is contained in:
Cerber Ursi
2021-11-27 19:10:28 +07:00
parent 7f8103101a
commit 23a7b089e4
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "uneval"
version = "0.1.1"
version = "0.2.0"
authors = ["k.bagrov <k.bagrov@g.nsu.ru>"]
edition = "2018"
description = "Serde serializer to embed data as Rust code"
+4
View File
@@ -10,6 +10,10 @@ This crate was inspired by the [Stack Overflow question](https://stackoverflow.c
This crate is intended to be used from the build script. It will serialize anything you provide to it to any path you provide (or to the arbitrary [`io::Write`](https://doc.rust-lang.org/stable/std/io/trait.Write.html) implementation, or into `String`, if you want to). Then, you'll [`include!`](https://doc.rust-lang.org/stable/std/macro.include.html) the generated file wherever you want to use it.
### How does it work?
See the [crate documentation](https://docs.rs/uneval) for details. In short, we use information provided by Serde to emit the code, which, when assigned to the variable of correct type, will provide all necessary conversions by using `Into` and iterators.
### Is it really that simple?
Well... not. There are several limitations.