Skip to content

Commit

Permalink
refactor: field access implementation (#10)
Browse files Browse the repository at this point in the history
This refactor replaces code created early on to wrap struct field access with rid ffi.
It didn't share any of the types nor render methods with the remaining code.

The new implementation does so as much as possible even though in some areas rendered code has to be somewhat different due to just providing references to data held on by the store directly or indirectly vs. values that are sent to Dart and not held on by Rust at all after that.

Lots of tests were added as well, mainly for the generated Rust code.

- rid-macro: model fields accessors using newer parsed data
- rid-macro: test field access for primitives and strings
- rid-macro: fix display + debug tests
- rid-macro: field access for custom struct
- rid-macro: field access vec<struct|prim> render rust
- rid-macro: field vec dart return type and control vec access rendering
- rid-macro: fixed vec access rendering for fields
- rid-macro: fixed field access dart return type for enums
- rid-macro: properly snakecased field access module name
- rid-macro: using new fieldacess implementaion
- rid-macro: rip out old field access impl + types
  • Loading branch information
thlorenz authored Jul 31, 2021
1 parent d82cc91 commit 5430376
Show file tree
Hide file tree
Showing 28 changed files with 1,534 additions and 1,103 deletions.
92 changes: 0 additions & 92 deletions rid-macro-impl/src/common/dart.rs

This file was deleted.

6 changes: 0 additions & 6 deletions rid-macro-impl/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
pub mod dart;
pub mod errors;
pub mod parsed_field;
pub mod prefixes;
pub mod rust;
pub mod state;
mod syn_helpers;
pub mod tokens;

pub use dart::DartType;
pub use errors::*;
pub use parsed_field::ParsedField;
pub use rust::{extract_path_segment, PrimitiveType, RustType, ValueType};
pub use syn_helpers::*;

// Test replacements
Expand Down
55 changes: 0 additions & 55 deletions rid-macro-impl/src/common/parsed_field.rs

This file was deleted.

Loading

0 comments on commit 5430376

Please sign in to comment.