Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
torkleyy committed Oct 16, 2021
0 parents commit bfe81cd
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitattributes
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
120 changes: 120 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
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 = "*"
9 changes: 9 additions & 0 deletions data/canada.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/canada.ron

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/main.rs
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();
}

0 comments on commit bfe81cd

Please sign in to comment.