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

Allow the name and value in set_string to be 2 different types #3412

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

Conversation

kerosina
Copy link

@kerosina kerosina commented Jan 3, 2025

Currently, windows_registry::key::Key::set_string takes one generic type T which implements AsRef<str>, which is the type of the arguments name and value. This signature is too restrictive, since both arguments must be of the same concrete type, while it should accept, for example, key.set_string(String::from("Name"),"Value").

This PR adds a new generic type U, with the same trait bound as T and which is the type of value, thereby allowing the aforementioned situation and similar cases where the 2 arguments have different concrete types that fulfill the same trait bound.

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.

2 participants