Skip to content

Derive field publicity based on source struct fields in derive macro #19

Description

@aapoalas

Right now we derive:

pub struct Foo {
  a: u32,
  pub(crate) b: u32,
}

// => 
pub struct FooRef<'a> {
  pub a: &'a u32,
  pub b: &'a u32,
}

We should probably rather derive the field publicity based on the source struct, so in this case b would become pub(crate) while a is entirely private.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions