Skip to content

Commit

Permalink
portable: Retain the provided type IDs (#174)
Browse files Browse the repository at this point in the history
* ty: Make type fields public

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Add recursive type ID resolver

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Check recursive type ID correctness

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Implement `retain` on the `PortableRegistry`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Check `retain` method

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Add error type

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* derive: Fix clippy and improve documentation

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rustfmt: Change deprecated fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Ensure no-std works

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* test_suite: Adjust UI tests to latest

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust UI tests with nightly

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Remove AtomicU32

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Use DFS for recursive ID assignment

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ty: Implement zero-alloc Default::default() for Type

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Change `retain` signature with FnMut

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable/tests: Apply clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* git: Use clippy with `--all-targets`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ty: Make fields public to this crate `pub(crate)` only

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: Use `mem` from `prelude` and not from `std`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* retain

* portable: Modify docs and apply fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable/test: Check result BTreeMap

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix cargo check

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Recursive retain for all type-def types

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ty: Use placeholder instead of implementing dummy Default::default()

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* portable: use crate::prelude::vec![] insted of vec![]

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update src/portable.rs

Co-authored-by: James Wilson <james@jsdw.me>

* portable: Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update src/portable.rs

Co-authored-by: Andrew Jones <ascjones@gmail.com>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
  • Loading branch information
3 people committed Mar 21, 2023
1 parent 2721f93 commit ce21de5
Show file tree
Hide file tree
Showing 10 changed files with 588 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: clippy
run: |
cargo clippy --version
cargo clippy --all -- -D warnings
cargo clippy --all-targets -- -D warnings
- name: check-all-features
run: |
Expand Down
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct_field_align_threshold = 0
enum_discrim_align_threshold = 0
match_arm_blocks = true
force_multiline_blocks = true # changed
fn_args_layout = "Tall"
fn_params_layout = "Tall"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
trailing_semicolon = false # changed
Expand Down
2 changes: 1 addition & 1 deletion derive/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn make_where_clause<'a>(
}
});

generics.type_params().into_iter().for_each(|type_param| {
generics.type_params().for_each(|type_param| {
let ident = type_param.ident.clone();
let mut bounds = type_param.bounds.clone();
if attrs
Expand Down

0 comments on commit ce21de5

Please sign in to comment.