Skip to content

Minor refactorings for build.rs#1430

Open
tesuji wants to merge 2 commits intoRust-SDL2:masterfrom
tesuji:cloned-more
Open

Minor refactorings for build.rs#1430
tesuji wants to merge 2 commits intoRust-SDL2:masterfrom
tesuji:cloned-more

Conversation

@tesuji
Copy link
Contributor

@tesuji tesuji commented Sep 8, 2024

Use clone when appropriate.

let include_paths: Vec<String> = if cfg!(feature = "bundled") {
vec![sdl2_includes]
} else {
compute_include_paths(sdl2_includes)
Copy link
Contributor

Choose a reason for hiding this comment

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

This fails to compile with bindgen and bundled features enabled, so please put the call to compute_include_paths back behind #[cfg(not(feature = "bundled"))].

I get that the formatting could be better, how about this instead?

#[cfg(feature = "bundled")]
let include_paths = vec![sdl2_includes];

#[cfg(not(feature = "bundled"))]
let include_paths = compute_include_paths(sdl2_includes);

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.

2 participants