Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Addresses fields public #22

Open
David-OConnor opened this issue Nov 15, 2021 · 2 comments
Open

Make Addresses fields public #22

David-OConnor opened this issue Nov 15, 2021 · 2 comments

Comments

@David-OConnor
Copy link
Contributor

David-OConnor commented Nov 15, 2021

So you can set things while leaving the rest default:

let addresses = Addresses {
    rf_channel: RF_CHANNEL,
    ..Default::default();
}

I don't think there's another way to do this currently without hand copying the pipe addresses etc.

@thalesfragoso
Copy link
Owner

The rf_channel field is actually checked in Addresses::new, and other code relies on that. So, we can't just make the fields public.

@David-OConnor
Copy link
Contributor Author

David-OConnor commented Jan 26, 2022

You could check rf_channel later, and make the fields public. Addresses doesn't do much on its own; it could be classified as a config struct.

Without making this or a related change (there are several alternatives that don't involve making the field public, such as setter methods, alternative constructors that accept channel args etc; although I think what I proposed is the cleanest for application and this lib code), how would you handle this in application code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants