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

Fix example #2110

Closed
wants to merge 1 commit into from
Closed

Fix example #2110

wants to merge 1 commit into from

Conversation

FlusherDock1
Copy link

Fixes error inside readme example:

error: cannot find macro `h` in this scope
 --> src\main.rs:8:17
  |
8 |     doc.LoadXml(h!("<html>hello world</html>"))?;
  |                 ^ help: a macro with a similar name exists: `s`
  |
 ::: windows-0.42.0\src\core\strings\literals.rs:3:1
  |
3 | macro_rules! s {
  | -------------- similarly named macro `s` defined here

Fixes error: 

```
error: cannot find macro `h` in this scope
 --> src\main.rs:8:17
  |
8 |     doc.LoadXml(h!("<html>hello world</html>"))?;
  |                 ^ help: a macro with a similar name exists: `s`
  |
 ::: C:\Users\rzzsa\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.42.0\src\core\strings\literals.rs:3:1
  |
3 | macro_rules! s {
  | -------------- similarly named macro `s` defined here
```
@kennykerr
Copy link
Collaborator

kennykerr commented Oct 21, 2022

That example isn't broken. 😏 It represents the next version of the windows crate...

/// A literal HSTRING, length-prefixed wide string with a trailing null terminator for use with WinRT APIs.
///
/// Converts the literal UTF-8 string into a UTF-16 string adding a terminator and then wrapping
/// that in an HSTRING reference so that it can be used for calling both WinRT APIs expecting an
/// HSTRING.
#[macro_export]
macro_rules! h {

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