-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - fix "unused" warnings when compiling with render
feature but without animation
#4714
[Merged by Bors] - fix "unused" warnings when compiling with render
feature but without animation
#4714
Conversation
crates/bevy_gltf/src/loader.rs
Outdated
#[cfg(feature = "bevy_animation")] | ||
use bevy_animation::{AnimationClip, AnimationPlayer, EntityPath, Keyframes, VariableCurve}; | ||
#[cfg(feature = "bevy_animation")] | ||
use bevy_math::Quat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these imports into path_recur instead (maybe using absolute paths for the signature?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (the imports aren't used in path_recur, but in #[cfg]
d blocks in load_gltf
): 83d8e47
bors r+ |
…t `animation` (#4714) # Objective When running `cargo check --no-default-features --features render` I get ```rust warning: unused import: `Quat` --> crates/bevy_gltf/src/loader.rs:11:23 | 11 | use bevy_math::{Mat4, Quat, Vec3}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: function is never used: `paths_recur` --> crates/bevy_gltf/src/loader.rs:542:4 | 542 | fn paths_recur( | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ``` ## Solution Put these items behind `#[cfg(feature = "animation")]`.
render
feature but without animation
render
feature but without animation
…t `animation` (bevyengine#4714) # Objective When running `cargo check --no-default-features --features render` I get ```rust warning: unused import: `Quat` --> crates/bevy_gltf/src/loader.rs:11:23 | 11 | use bevy_math::{Mat4, Quat, Vec3}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: function is never used: `paths_recur` --> crates/bevy_gltf/src/loader.rs:542:4 | 542 | fn paths_recur( | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ``` ## Solution Put these items behind `#[cfg(feature = "animation")]`.
…t `animation` (bevyengine#4714) # Objective When running `cargo check --no-default-features --features render` I get ```rust warning: unused import: `Quat` --> crates/bevy_gltf/src/loader.rs:11:23 | 11 | use bevy_math::{Mat4, Quat, Vec3}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: function is never used: `paths_recur` --> crates/bevy_gltf/src/loader.rs:542:4 | 542 | fn paths_recur( | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ``` ## Solution Put these items behind `#[cfg(feature = "animation")]`.
…t `animation` (bevyengine#4714) # Objective When running `cargo check --no-default-features --features render` I get ```rust warning: unused import: `Quat` --> crates/bevy_gltf/src/loader.rs:11:23 | 11 | use bevy_math::{Mat4, Quat, Vec3}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: function is never used: `paths_recur` --> crates/bevy_gltf/src/loader.rs:542:4 | 542 | fn paths_recur( | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ``` ## Solution Put these items behind `#[cfg(feature = "animation")]`.
Objective
When running
cargo check --no-default-features --features render
I getSolution
Put these items behind
#[cfg(feature = "animation")]
.