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 feature dependencies #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn seed() -> u64 {
}

/// It can be fatal if you step hard enough.
#[cfg(any(feature = "give-up", feature = "step-on-lego"))]
#[cfg(feature = "step-on-lego")]
pub fn step_on_lego() -> u32 {
let mut rng = oorandom::Rand64::new(seed() as u128);

Expand All @@ -74,7 +74,7 @@ pub fn step_on_lego() -> u32 {
}

/// Good for job security.
#[cfg(any(feature = "give-up", feature = "step-on-lego"))]
#[cfg(feature = "give-up")]
pub fn give_up<T: 'static>() -> Box<T> {
let size = std::mem::size_of::<T>();

Expand Down Expand Up @@ -131,4 +131,10 @@ mod tests {
fn can_download_more_ram() {
crate::download_more_ram::<u64>();
}

#[test]
#[cfg(feature = "step-on-lego")]
fn can_step_on_lego() {
crate::step_on_lego();
}
}
Loading