Skip to content

Commit

Permalink
Fix typos (#215)
Browse files Browse the repository at this point in the history
* fix typos

* fix typo

* fix typo

* fix typos
  • Loading branch information
omahs authored Nov 21, 2023
1 parent d84f78a commit 9c69b1f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/docs/command_line_flags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cddl-codegen --input=example --output=export --wasm false
:::info `--preserve-encodings`
Preserves CBOR encoding upon deserialization e.g. definite vs indefinite, map ordering. For each module this will also create a `cbor_encodings.rs` file to potentially store any structs for storing these encodings. This option is useful if you need to preserve the deserialized format for round-tripping (e.g. hashes) or if you want to modify the format to conincide with a specific tool for hashing.
Preserves CBOR encoding upon deserialization e.g. definite vs indefinite, map ordering. For each module this will also create a `cbor_encodings.rs` file to potentially store any structs for storing these encodings. This option is useful if you need to preserve the deserialized format for round-tripping (e.g. hashes) or if you want to modify the format to coincide with a specific tool for hashing.
Possible values: true, false
```bash
Expand Down Expand Up @@ -139,7 +139,7 @@ cddl-codegen --input=example --output=export --package-json true --json-schema-e
:::info `--common-import-override`
Overrides the location of the static exports (e.g. error.rs, serialization.rs, etc).
This is particularily useful for combining multiple crates each generated using cddl-codegen where they all share a shared core directory where the static files are located.
This is particularly useful for combining multiple crates each generated using cddl-codegen where they all share a shared core directory where the static files are located.
**Default:** crate
```bash
Expand Down Expand Up @@ -175,4 +175,4 @@ The macro must take the rust type as the first parameter and the wasm wrapper ty
```bash
cddl-codegen --input=example --output=export --wasm-conversion-macro=cml_core_wasm::impl_wasm_conversions
```
:::
:::
2 changes: 1 addition & 1 deletion docs/docs/comment_dsl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ bar = [
]
```
This will treat `foo` as some external type called `Foo`. This type must implement the exported (in `serialization.rs`) trait `RawBytesEncoding`.
This can be useful for example when working with cryptographic primtivies e.g. a hash or pubkey, as it allows users to have those crypto structs be from a crypto library then they only need to implement the trait for them and they will be able to be directly used without needing any useless generated wrapper struct for the in between.
This can be useful for example when working with cryptographic primitives e.g. a hash or pubkey, as it allows users to have those crypto structs be from a crypto library then they only need to implement the trait for them and they will be able to be directly used without needing any useless generated wrapper struct for the in between.
2 changes: 1 addition & 1 deletion docs/docs/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ other_basic = (



Basic groups can be embeded in maps, BUT deserialization will not be generated due to technical limitations
Basic groups can be embedded in maps, BUT deserialization will not be generated due to technical limitations

:::warning limitation
A single basic group cannot be put into both a map and an array group for serialization which is
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/wasm_differences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ In the wasm crate we can't always go one to one with the rust crate. Here are so

## Heterogeneous Arrays

`wasm_bindgen` cannot expose doubly-nested types like `Vec<Vec<T>` which can be a limitation if `T` was a non-byte primtive.
`wasm_bindgen` cannot expose doubly-nested types like `Vec<Vec<T>` which can be a limitation if `T` was a non-byte primitive.
Any array of non-primitives such as `[foo]` will generate another type called `FooList` which supports all basic array operations.
This lets us get around the `wasm_bindgen` limitation (without implementing cross-boundary traits which could be inefficient/tedious/complicated).
This array wrapper implements `len() -> self`, `get(usize) -> T` and `add(T)`.

## Tables

Map literals also generate a type for them with `len() -> usize` and `insert(K, V) -> Option<V>`. The table type will have a `MapKeyToValue` name for whichever `Key` and `Value` types it's exposed as if it's anonymously inlined a as a member, or will take on the identifier if it's a named one.
Map literals also generate a type for them with `len() -> usize` and `insert(K, V) -> Option<V>`. The table type will have a `MapKeyToValue` name for whichever `Key` and `Value` types it's exposed as if it's anonymously inlined as a member, or will take on the identifier if it's a named one.

## Enums

Expand Down

0 comments on commit 9c69b1f

Please sign in to comment.