Skip to content

Error on pattern destructuring on readonly structs #4

@CGMossa

Description

@CGMossa

First, I love this crate and I am using it everywhere.

I've this scenario where

#[readonly::make]
#[derive(Debug, Default)]
pub struct TallySpecificType { 
pub a_field: usize,
}

And somewhere along the way, I want to

let TallySpecificType { a_field } = some_tally_specific_type;

But I get erros on a_field being a private-field. I understand that this prevents me from constructing this struct "outside" of
it, which is something I want to keep, but the destructuring should be possible irregardless.

What am I missing here? Some &*? Or is there as misunderstanding somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions