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

Refactor winapi usage to windows-sys #10

Closed
passcod opened this issue Dec 28, 2022 · 3 comments · Fixed by #26
Closed

Refactor winapi usage to windows-sys #10

passcod opened this issue Dec 28, 2022 · 3 comments · Fixed by #26
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@passcod
Copy link
Member

passcod commented Dec 28, 2022

Note

TWIR CFP - Difficulty: medium. Requires knowledge of Windows APIs and unsafe FFI handling.

The winapi crate, while not deprecated, hasn't received an update since 2020. This is because the windows and windows-sys crates have completely supplanted it.

Clearscreen has a bit of winapi code to write terminal escapes and configure the console:

https://github.com/watchexec/clearscreen/blob/main/src/lib.rs#L791-L821

While this code is stable, it would be a nice, self-contained refactor to move it to the windows-sys crate.

As part of this refactor, assess the unsafe usage in the new code, adding appropriate // SAFETY: comments. There is no need to audit the existing unsafe code as part of this task.

@RubyBit

This comment has been minimized.

@passcod passcod added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 1, 2025
@passcod passcod changed the title Move off winapi Refactor winapi usage to windows-sys, and audit unsafe Windows FFI Jan 1, 2025
@passcod passcod changed the title Refactor winapi usage to windows-sys, and audit unsafe Windows FFI Refactor winapi usage to windows-sys Jan 1, 2025
nellshamrell added a commit to rust-lang/this-week-in-rust that referenced this issue Jan 1, 2025
@ASamedWalker
Copy link

Hi, I am very interested in contributing to this issue. Although I am new to Rust and this would be my first time contributing to open-source, I am eager to learn and would greatly appreciate any guidance to help me address this task. While I will do my best to make progress promptly, I may require additional time and support to ensure the solution meets the project’s standards. Thanks

@passcod
Copy link
Member Author

passcod commented Jan 4, 2025

Sorry @ASamedWalker, #26 has already gotten there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants