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

Missing conversion from HSTRING to PCWSTR makes it more verbose to fill out structs #2295

Closed
Flakebi opened this issue Jan 19, 2023 · 2 comments

Comments

@Flakebi
Copy link

Flakebi commented Jan 19, 2023

0.44.0 allows passing &HSTRING to places that expect a PCWSTR, which is a nice change.
However, as &HSTRING: Into<PCWSTR> is gone now, it makes it slightly more verbose to fill out structs, e.g. for dx12:

// Previously
let export = D3D12_EXPORT_DESC {
    Name: (&name).into(),
    ExportToRename: None,
    ..Default::default()
};

// Now
let export = D3D12_EXPORT_DESC {
    Name: PCWSTR(name.as_ptr()),
    ExportToRename: None,
    ..Default::default()
};

If that’s intended, it’s fine with me, it’s not thaat much more verbose. Just wanted to bring it up because it this case was not mentioned in the PR.

@tim-weis
Copy link
Contributor

The &HSTRINGPCWSTR conversion was removed in #2144 (see #2082 for rationale).

@Flakebi
Copy link
Author

Flakebi commented Jan 19, 2023

Makes sense, thanks for the reference!

@Flakebi Flakebi closed this as completed Jan 19, 2023
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

No branches or pull requests

2 participants