Skip to content

Commit

Permalink
Merge pull request #472 from juntyr/v0.8.1
Browse files Browse the repository at this point in the history
Bump ron to v0.8.1
  • Loading branch information
juntyr committed Aug 17, 2023
2 parents 4089034 + 90fd484 commit eafa2b6
Show file tree
Hide file tree
Showing 50 changed files with 1,450 additions and 472 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
rust: [1.56.0, stable, nightly]
rust: [1.64.0, stable, nightly]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
profile: minimal
components: llvm-tools-preview
override: true
- run: cargo install grcov --force --locked
- run: cargo install grcov --force
env:
CARGO_TARGET_DIR: target/
- run: |
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.8.1] - 2023-08-17
- Fix issues [#277](https://github.com/ron-rs/ron/issues/277) and [#405](https://github.com/ron-rs/ron/issues/405) with `Value::Map` `IntoIter` and extraneous item check for `Value::Seq` ([#406](https://github.com/ron-rs/ron/pull/406))
- Fix issue [#401](https://github.com/ron-rs/ron/issues/401) with correct raw struct name identifier parsing ([#402](https://github.com/ron-rs/ron/pull/402))
- Fix issue [#410](https://github.com/ron-rs/ron/issues/410) trailing comma parsing in tuples and `Some` ([#412](https://github.com/ron-rs/ron/pull/412))
- Error instead of panic when deserializing non-identifiers as field names ([#415](https://github.com/ron-rs/ron/pull/415))
- [Non-API] Breaking: Fix issue [#307](https://github.com/ron-rs/ron/issues/307) stack overflow with explicit recursion limits in serialising and deserialising ([#420](https://github.com/ron-rs/ron/pull/420))
- Fix issue [#423](https://github.com/ron-rs/ron/issues/423) deserialising an identifier into a borrowed str ([#424](https://github.com/ron-rs/ron/pull/424))
- Bump MSRV to 1.57.0 and bump dependency: `base64` to 0.20 ([#431](https://github.com/ron-rs/ron/pull/431))
- Bump dependency `base64` to 0.21 ([#433](https://github.com/ron-rs/ron/pull/433))
- Depend on `serde_derive` directly to potentially enable more compilation parallelism ([#441](https://github.com/ron-rs/ron/pull/441))
- [Non-API] Breaking: Bump `bitflags` dependency to 2.0, changes `serde` impls of `Extensions` ([#443](https://github.com/ron-rs/ron/pull/443))
- Add `Map::retain` method ([#460](https://github.com/ron-rs/ron/pull/460))
- Bump MSRV to 1.64.0 and bump dependency: `indexmap` to 2.0 ([#459](https://github.com/ron-rs/ron/pull/459))

## [0.8.0] - 2022-08-17

- Bump dependencies: `bitflags` to 1.3, `indexmap` to 1.9 ([#399](https://github.com/ron-rs/ron/pull/399))
Expand Down
22 changes: 12 additions & 10 deletions Cargo.toml
@@ -1,14 +1,14 @@
[package]
name = "ron"
# Memo: update version in src/lib.rs too (doc link)
version = "0.8.0"
version = "0.8.1"
license = "MIT OR Apache-2.0"
keywords = ["parser", "serde", "serialization"]
authors = [
"Christopher Durham <cad97@cad97.com>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
"Thomas Schaller <torkleyy@gmail.com>",
"Juniper Langenstein <juniper.langenstein@helsinki.fi>",
"Juniper Tyree <juniper.tyree@helsinki.fi>",
]
edition = "2021"
description = "Rusty Object Notation"
Expand All @@ -17,20 +17,22 @@ readme = "README.md"
homepage = "https://github.com/ron-rs/ron"
repository = "https://github.com/ron-rs/ron"
documentation = "https://docs.rs/ron/"
rust-version = "1.56.0"
rust-version = "1.64.0"

[features]
default = []
integer128 = []

[dependencies]
base64 = "0.13"
bitflags = "1.3.2"
indexmap = { version = "1.9.1", features = ["serde-1"], optional = true }
serde = { version = "1.0.60", features = ["serde_derive"] }
base64 = "0.21"
bitflags = { version = "2.0", features = ["serde"] }
indexmap = { version = "2.0", features = ["serde"], optional = true }
# serde supports i128/u128 from 1.0.60 onwards
serde = "1.0.60"
serde_derive = "1.0"

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1"
bitflags-serial = { git = "https://github.com/kvark/bitflags-serial" }
option_set = "0.1"
serde_json = "1.0"
option_set = "0.2"
25 changes: 18 additions & 7 deletions README.md
Expand Up @@ -3,7 +3,7 @@
[![CI](https://github.com/ron-rs/ron/actions/workflows/ci.yaml/badge.svg)](https://github.com/ron-rs/ron/actions/workflows/ci.yaml)
[![codecov](https://img.shields.io/codecov/c/github/ron-rs/ron/codecov?token=x4Q5KA51Ul)](https://codecov.io/gh/ron-rs/ron)
[![Crates.io](https://img.shields.io/crates/v/ron.svg)](https://crates.io/crates/ron)
[![MSRV](https://img.shields.io/badge/MSRV-1.56.0-orange)](https://github.com/ron-rs/ron)
[![MSRV](https://img.shields.io/badge/MSRV-1.64.0-orange)](https://github.com/ron-rs/ron)
[![Docs](https://docs.rs/ron/badge.svg)](https://docs.rs/ron)
[![Matrix](https://img.shields.io/matrix/ron-rs:matrix.org.svg)](https://matrix.to/#/#ron-rs:matrix.org)

Expand All @@ -18,23 +18,23 @@ GameConfig( // optional struct name
window_size: (800, 600),
window_title: "PAC-MAN",
fullscreen: false,
mouse_sensitivity: 1.4,
key_bindings: {
"up": Up,
"down": Down,
"left": Left,
"right": Right,
// Uncomment to enable WASD controls
/*
"W": Up,
"A": Down,
"S": Left,
"S": Down,
"A": Left,
"D": Right,
*/
},
difficulty_options: (
start_difficulty: Easy,
adaptive: false,
Expand Down Expand Up @@ -102,6 +102,13 @@ Note the following advantages of RON over JSON:
* optional struct names improve readability
* enums are supported (and less verbose than their JSON representation)

## Limitations

RON is not designed to be a fully self-describing format (unlike JSON) and is thus not guaranteed to work when [`deserialize_any`](https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_any) is used instead of its typed alternatives. In particular, the following Serde attributes are not yet supported:
- `#[serde(tag = "type")]`, i.e. internally tagged enums
- `#[serde(untagged)]`, i.e. untagged enums
- `#[serde(flatten)]`, i.e. flattening an inner struct into its outer container

## RON syntax overview

* Numbers: `42`, `3.14`, `0xFF`, `0b0110`
Expand Down Expand Up @@ -139,8 +146,12 @@ struct MyStruct {

fn main() {
let x: MyStruct = ron::from_str("(boolean: true, float: 1.23)").unwrap();

println!("RON: {}", ron::to_string(&x).unwrap());

println!("Pretty RON: {}", ron::ser::to_string_pretty(
&x, ron::ser::PrettyConfig::default()).unwrap(),
);
}
```

Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
@@ -1,2 +1,2 @@
msrv = "1.56.0"
msrv = "1.64.0"
blacklisted-names = []
14 changes: 13 additions & 1 deletion docs/grammar.md
Expand Up @@ -18,7 +18,8 @@ RON = [extensions], ws, value, ws;
```ebnf
ws = { ws_single | comment };
ws_single = "\n" | "\t" | "\r" | " ";
comment = ["//", { no_newline }, "\n"] | ["/*", { ? any character ? }, "*/"];
comment = ["//", { no_newline }, "\n"] | ["/*", nested_block_comment, "*/"];
nested_block_comment = { ? any characters except "/*" or "*/" ? }, [ "/*", nested_block_comment, "*/", nested_block_comment ];
```

## Commas
Expand Down Expand Up @@ -138,3 +139,14 @@ enum_variant_unit = ident;
enum_variant_tuple = ident, ws, tuple;
enum_variant_named = ident, ws, "(", [named_field, { comma, named_field }, [comma]], ")";
```

## Identifier

```ebnf
ident = ident_std | ident_raw;
ident_std = ident_std_first, { ident_std_rest };
ident_std_first = "A" | ... | "Z" | "a" | ... | "z" | "_";
ident_std_rest = ident_std_first | digit;
ident_raw = "r", "#", ident_raw_rest, { ident_raw_rest };
ident_raw_rest = ident_std_rest | "." | "+" | "-";
```
3 changes: 2 additions & 1 deletion examples/decode.rs
@@ -1,8 +1,9 @@
#![allow(dead_code)]

use std::collections::HashMap;

use ron::de::from_str;
use serde::Deserialize;
use std::collections::HashMap;

#[derive(Debug, Deserialize)]
struct Config {
Expand Down
3 changes: 2 additions & 1 deletion examples/decode_file.rs
@@ -1,8 +1,9 @@
#![allow(dead_code)]

use std::{collections::HashMap, fs::File};

use ron::de::from_reader;
use serde::Deserialize;
use std::{collections::HashMap, fs::File};

#[derive(Debug, Deserialize)]
struct Config {
Expand Down
3 changes: 2 additions & 1 deletion examples/encode.rs
@@ -1,6 +1,7 @@
use std::{collections::HashMap, iter::FromIterator};

use ron::ser::{to_string_pretty, PrettyConfig};
use serde::Serialize;
use std::{collections::HashMap, iter::FromIterator};

#[derive(Serialize)]
struct Config {
Expand Down
8 changes: 4 additions & 4 deletions fuzz/.gitignore
@@ -1,4 +1,4 @@

target
corpus
artifacts
/artifacts
/corpus
/target
/Cargo.lock
109 changes: 0 additions & 109 deletions fuzz/Cargo.lock

This file was deleted.

13 changes: 9 additions & 4 deletions fuzz/Cargo.toml
Expand Up @@ -2,18 +2,17 @@
[package]
name = "ron-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"

[package.metadata]
cargo-fuzz = true

[dependencies]
arbitrary = { version = "1.0", features = ["derive"] }
libfuzzer-sys = "0.4"

[dependencies.ron]
path = ".."
ron = { path = "..", features = ["integer128"] }
serde = { version = "1.0", features = ["derive"] }

# Prevent this from interfering with workspaces
[workspace]
Expand All @@ -24,3 +23,9 @@ name = "from_str"
path = "fuzz_targets/from_str.rs"
test = false
doc = false

[[bin]]
name = "arbitrary"
path = "fuzz_targets/arbitrary.rs"
test = false
doc = false

0 comments on commit eafa2b6

Please sign in to comment.