Skip to content

Commit

Permalink
Use/fix ron code blocks (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
spenserblack committed Jun 11, 2024
1 parent 0bc9a6e commit 6f57f24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ structs, enums, tuples, arrays, generic maps, and primitive values.

## Example

```rust,ignore
```ron
GameConfig( // optional struct name
window_size: (800, 600),
window_title: "PAC-MAN",
Expand Down Expand Up @@ -98,7 +98,7 @@ There also is a very basic, work in progress specification available on

### Same example in RON

```rust,ignore
```ron
Scene( // class name is optional
materials: { // this is a map
"metal": (
Expand Down
8 changes: 4 additions & 4 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ struct Object {

Without `unwrap_newtypes`, because the value `5` can not be saved into `NewType(u32)`, your RON document would look like this:

``` ron
```ron
(
new_type: (5),
)
```

With the `unwrap_newtypes` extension, this coercion is done automatically. So `5` will be interpreted as `(5)`.

``` ron
```ron
#![enable(unwrap_newtypes)]
(
new_type: 5,
Expand Down Expand Up @@ -98,15 +98,15 @@ pub enum Enum {

Without `unwrap_variant_newtypes`, your RON document would look like this:

``` ron
```ron
(
variant: A(Inner(a: 4, b: true)),
)
```

With the `unwrap_variant_newtypes` extension, the first structural layer inside a newtype variant will be unwrapped automatically:

``` ron
```ron
#![enable(unwrap_newtypes)]
(
variant: A(a: 4, b: true),
Expand Down

0 comments on commit 6f57f24

Please sign in to comment.