-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bfe81cd
Showing
7 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[attr]saneWs text eol=lf whitespace=tab-in-indent,space-before-tab,blank-at-eol,-blank-at-eof,tabwidth=4 | ||
|
||
* text=auto eol=lf | ||
*.rs saneWs | ||
*.ron saneWs | ||
*.toml saneWs | ||
*.md saneWs | ||
Cargo.lock text | ||
|
||
.gitattributes saneWs | ||
.gitignore saneWs | ||
|
||
/data/*.json binary | ||
/data/*.ron binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "ron-bench" | ||
version = "0.1.0" | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
ron = { git = "https://github.com/ron-rs/ron" } | ||
ron-reboot = { git = "https://github.com/ron-rs/ron-reboot" } | ||
serde_json = "*" |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::fs::File; | ||
use ron::ser::to_writer; | ||
use ron::Value; | ||
use serde_json::from_reader as json_from_reader; | ||
|
||
const MIN_NUM_VALUE: usize = 10_000; | ||
|
||
fn gen_value(num: usize) -> Value { | ||
Value::Bool(true) | ||
} | ||
|
||
// Convert .json to .ron | ||
fn main() { | ||
let value: serde_json::Value = json_from_reader(File::open("data/canada.json").unwrap()).unwrap(); | ||
to_writer(File::create("data/canada.ron").unwrap(), &value).unwrap(); | ||
} |