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

Rename kind (used as alias for type) #1318

Closed
1 of 3 tasks
zoechi opened this issue Jun 16, 2020 · 7 comments
Closed
1 of 3 tasks

Rename kind (used as alias for type) #1318

zoechi opened this issue Jun 16, 2020 · 7 comments
Labels
feature-request A feature request

Comments

@zoechi
Copy link
Contributor

zoechi commented Jun 16, 2020

Describe the feature you'd like
I find kind as alias for type, which conflicts with Rust's type keyword, confusing
and propose to change it to type
and to use type_ as alias where type conflicts with the keyword.

I'm of course open for other suggestions how to prevent the conflict,
it's just that kind seems too different to make a good candidate.

Is your feature request related to a problem? Please describe. (Optional)
See the discussion in
#1298
It's not obvious that kind stands for type and it would need to be well documented, probably on all locations where it appears in public API.

In private APIs it might still confuse contributors.

Describe alternatives you've considered (Optional)
Improve documentation
#1298 (comment)

Additional context (Optional)
Add any other context or screenshots about the feature request here.

Questionnaire

  • I'm interested in implementing this myself but don't know where to start
  • I would like to add this feature
  • I don't have time to add this right now, but maybe later

I'd try to fix this after a consensus is found what should be used instead of type where it causes a syntax error because of the conflict with the type keyword.

@zoechi zoechi added the feature-request A feature request label Jun 16, 2020
@jstarry
Copy link
Member

jstarry commented Jun 20, 2020

@zoechi how about input_type?

@zoechi
Copy link
Contributor Author

zoechi commented Jun 20, 2020

Discoverability is probably not great if it does not start with type

@jstarry
Copy link
Member

jstarry commented Jun 20, 2020

@zoechi I don't think discoverability is an issue, can you elaborate which API you are concerned about?

@zoechi
Copy link
Contributor Author

zoechi commented Jun 22, 2020

Right, we could still use VTag::set_type() and have the struct field named input_type.
#1322 should make this field obsolete anyway.

@jstarry
Copy link
Member

jstarry commented Jun 22, 2020

True, what do you think about pursuing #1322 instead?

@zoechi
Copy link
Contributor Author

zoechi commented Jun 22, 2020

@jstarry see #1322 (comment)
I need to improve my Rust-Fu to better understand Yew code first, but otherwise I'm interested.

@mc1098
Copy link
Contributor

mc1098 commented Sep 20, 2021

I'm closing this issue because this has been fixed :) I don't know when but kind as an alias for type is not used by Yew anymore 🎉

@mc1098 mc1098 closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature request
Projects
None yet
Development

No branches or pull requests

3 participants