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

Used std::ptr::null() instead of None in readme #1940

Closed
wants to merge 1 commit into from
Closed

Used std::ptr::null() instead of None in readme #1940

wants to merge 1 commit into from

Conversation

blwarren
Copy link

The current example in the readme produces a mismatched type error in which CreateEventW is expecting either a *const SECURITY_ATTRIBUTES or null. The error is corrected by replacing None in the example with std::ptr::null().

@kennykerr
Copy link
Collaborator

The repo's samples reflect the latest updates to the windows crate rather than what is available on crates.io - in other words, it is correct for the next version of the windows crate. Related: #1890

@blwarren
Copy link
Author

Ah, I understand. I made the mistake of working from the repo readme instead of the crates.io docs. Lesson learned! Thanks!

@blwarren blwarren closed this Jul 27, 2022
@msyyces8x95
Copy link

msyyces8x95 commented Aug 2, 2022

@kennykerr I checked using the last version from git, it works as intended : None instead of std::ptr::null() works fine.
A genuine question, next version will break backward compatibility for 'windows' crate ? compiling old code with master branch of the crate produces some error.

Example :
code : let conf_event = CreateEventW(std::ptr::null(), true, false, None)?;
error : Error : expected enum 'Option', found *-ptr

@rylev
Copy link
Contributor

rylev commented Aug 2, 2022

Yes, the windows crate does not yet guarantee backwards compatibility between versions. The rate of change is slowing, and hopefully we'll get there soon, but we're not there yet.

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.

4 participants