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

Support #[borrowme(std)] container attribute #5

Closed
jvdwrf opened this issue May 17, 2024 · 3 comments
Closed

Support #[borrowme(std)] container attribute #5

jvdwrf opened this issue May 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jvdwrf
Copy link

jvdwrf commented May 17, 2024

First of all I would like to thank you for such an amazing crate!
It's really something that is missing from rust, and this fills the gap perfectly.

Now to my issue: I have a bunch of custom fields, that all have the #[borrowme(std)] attribute on it.
It would be great if I could add this attribute on the container, to make it the default borrowing method for all fields.

i.e. something like this:

#[borrowme]
#[borrowme(std)]
struct Struct<'a> {
    field1: &'a CustomWrapper1,
    field2: &'a CustomWrapper2,
}

This would forward #[borrowme(std)] to all fields.

@udoprog udoprog changed the title borrowme(std) container attribute Support #[borrowme(std)] container attribute May 17, 2024
@udoprog udoprog added the enhancement New feature or request label May 17, 2024
@udoprog
Copy link
Owner

udoprog commented May 17, 2024

That's a great suggestion!

@udoprog
Copy link
Owner

udoprog commented May 18, 2024

I've added support for this in #6 and it's part of 0.0.15. Thank you for the suggestion!

@jvdwrf
Copy link
Author

jvdwrf commented May 21, 2024

Wow, that's fast! Thanks :)

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

No branches or pull requests

2 participants