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

[Merged by Bors] - fix "unused" warnings when compiling with render feature but without animation #4714

Closed

Conversation

jakobhellermann
Copy link
Contributor

Objective

When running cargo check --no-default-features --features render I get

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")].

@jakobhellermann jakobhellermann added the C-Code-Quality A section of code that is hard to understand or change label May 10, 2022
#[cfg(feature = "bevy_animation")]
use bevy_animation::{AnimationClip, AnimationPlayer, EntityPath, Keyframes, VariableCurve};
#[cfg(feature = "bevy_animation")]
use bevy_math::Quat;
Copy link
Member

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?)

Copy link
Contributor Author

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

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 10, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 10, 2022
…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")]`.
@bors bors bot changed the title fix "unused" warnings when compiling with render feature but without animation [Merged by Bors] - fix "unused" warnings when compiling with render feature but without animation May 10, 2022
@bors bors bot closed this May 10, 2022
robtfm pushed a commit to robtfm/bevy that referenced this pull request May 17, 2022
…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")]`.
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
…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")]`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…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")]`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants