Skip to content

Treat some references differently for ergonomics #13

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kirillsemyonkin
Copy link
Collaborator

Discovered by @Madoshakalaka

If a reference type is actually intended, #[autoprops] will currently ignore that and put a referenceless type into the props struct. For example:

#[autoprops]
#[component]
pub fn Test(string: &'static str) {
    html!{}
}

In this case 'static is ignored, and str is attempted to be put into props struct. As a workaround, currently works:

#[autoprops]
#[component]
pub fn Test(string: &&'static str) {
    html!{}
}

But it is unergonomic. It is well known that reference is wanted (by the lifetime specifier existing), so let's put such references into props struct as-is.

@kirillsemyonkin
Copy link
Collaborator Author

I'm not going to fix MSRV - I do not know what's the intent behind the chosen MSRV and such unspecific versions in Cargo.toml.
I had to update Cargo.lock because my latest stable did not work (something something web_sys outdated), but in doing so MSRV broke. If that's the issue, then versions should be pinned to last working ones instead of committing Cargo.lock, in which case Cargo will use both outdated lib dep for this library and updated in case someone is using another lib which uses the same dep.

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

Successfully merging this pull request may close these issues.

1 participant