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

Make winapi crate optional #119

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Nov 21, 2023

This PR makes winapi crate dependency optional.

Context:

  • My application doesn't handle image data. So I use this crate without image-data features.
  • winapi crate is very inactive (no commit for 3 years). Avoiding it as much as possible would be a good idea.

Without image-data, winapi is used only for syncapi::Sleep in this crate and it can be easily replaced with Rust standard std::thread::sleep. std::thread::sleep uses the same Sleep C function under the hood. As a side effect, std::thread::sleep leverages high-resolution timer. It could make the retry interval more accurate.

This doesn't remove winapi dependency immediately since clipboard-win v4 still depends on it. However clipboard-win will replace winapi dependency with windows-rs at next major version v5. When this crate bumps clipboard-win to v5, winapi dependency can be removed along with this PR (without image-data feature).

Copy link
Collaborator

@complexspaces complexspaces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, this seems reasonable to me.

Regarding winapi being used for image functionality, once a new version of clipboard-win is out I can replace winapi with windows-sys here, to remove it from the dependency tree fully.

@complexspaces complexspaces merged commit 8c475cf into 1Password:master Nov 22, 2023
7 checks passed
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.

None yet

2 participants