8000 Fix compiling when gamepad feature is disabled by orowith2os · Pull Request #1302 · ggez/ggez · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix compiling when gamepad feature is disabled #1302

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

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

orowith2os
Copy link

Previously, this would break compilation, because the trait bounds would never be met under this environment. This exposes the dummy object such that it's always met, and just a noop when running without gamepad support.

@orowith2os orowith2os force-pushed the default-features-false-fixes branch from 004873e to ed2af0f Compare January 15, 2025 03:58
Previously, this would break compilation, because the trait bounds would
never be met under this environment. This exposes the dummy object such
that it's always met, and just a noop when running without gamepad
support.
@orowith2os orowith2os force-pushed the default-features-false-fixes branch from ed2af0f to 00d97d0 Compare January 15, 2025 03:59
@orowith2os
Copy link
Author

Alright, fixed everything up nicely. Also properly got the warning_copy_implementations error to stop bothering us.

@Bowarc
Copy link
Bowarc commented Jan 15, 2025

Looks good to me

/// Dummy gamepad context, for if the gamepad feature is disabled, to allow trait bounds
/// to still resolve properly
#[derive(Debug)]
pub struct GamepadContext;
Copy link
Member

Choose a reason for hiding this comment

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

This structure should have a private field or be marked #[non_exhaustive] to avoid it being trivially constructible. This will probably let you get rid of the #![allow(missing_copy_implementations)].

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.

3 participants
0