Skip to content

Inconsistent naming of tree parameter in Widget trait #2949

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
4 tasks done
mfreeborn opened this issue May 18, 2025 · 0 comments · May be fixed by #2950
Open
4 tasks done

Inconsistent naming of tree parameter in Widget trait #2949

mfreeborn opened this issue May 18, 2025 · 0 comments · May be fixed by #2950
Labels
bug Something isn't working

Comments

@mfreeborn
Copy link

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

https://docs.iced.rs/iced/advanced/trait.Widget.html

The provided methods of the Widget trait use the name _state, whereas the required methods use tree, and it is these names which the IDE uses when auto-completing new methods that I want to impl on the trait.

tree is nicer, because then I can write let state = tree.state.downcast_ref::<...>() without shadowing the original Tree.

For consistency, it would be nicer to rename occurrences of _state to _tree. Saves me having to rewrite the parameter's name in its entirety vs just deleting the leading underscore if I want to use it in my impl.

What is the expected behavior?

.

Version

master

Operating System

Linux

Do you have any log output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant