Skip to content

Manifests: remove the dependencies no crate code uses - #1273

Open
dotCooCoo wants to merge 1 commit into
storytold:mainfrom
dotCooCoo:fix/unused-crate-dependencies
Open

dotCooCoo wants to merge 1 commit into
storytold:mainfrom
dotCooCoo:fix/unused-crate-dependencies

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

Summary

Cargo 1.100 reports unused dependency for four manifest entries under cargo clippy --workspace (the unused_dependencies lint: https://doc.rust-lang.org/cargo/reference/lints.html), and for a fifth, craft-video's thiserror, once those four are cleared.

  • craft-svg: craft-image-codecs is used only by the tree module. It is now optional, and tree turns it on with dep:craft-image-codecs. tree-text, tree-render and the other tree-* features still go through tree.
  • craft-update: getrandom = "0.3" is removed. No source, test or target-specific code in the crate uses it, and it set no features. Cargo.lock loses only that one edge; the getrandom 0.3.4 package stays for the other crates that use it.
  • craft-video: craft-media and thiserror are used only by the codec modules, so both are optional. dnx adds dep:craft-media; the other features whose modules use craft-media already name a craft-media/... feature, which turns the optional dependency on (https://doc.rust-lang.org/cargo/reference/features.html). Each feature whose module derives thiserror::Error (dnx, apv, vp8, mpeg2-decode, mpeg4-encode, prores, h264, hevc-decode, vp9-decode, av1-decode) adds dep:thiserror. The craft-media dev-dependency with avi stays for the mpeg4_encode test.

A build with no features no longer compiles craft-media and thiserror into craft-video, or craft-image-codecs into craft-svg. Every feature builds as before.

Validation

With cargo 1.100.0, on main at 6c894be8. The feature-by-feature checks ran on b77af389; the commits between the two change only crates/idml.

  • cargo fmt --all -- --check: clean.
  • cargo clippy --workspace --locked: 0 unused dependency warnings (4 on main at b77af389).
  • cargo check --workspace --tests --locked: passes.
  • cargo clippy -p craft-svg -p craft-update -p craft-video --all-targets --all-features -- -D warnings (one crate per run): passes.
  • cargo check -p craft-video --no-default-features, and --lib and --all-targets with each of the 17 codec leaf features on its own: passes with no unused dependency warnings.
  • cargo check -p craft-svg with no features, tree, tree-text, tree-render and --all-features, and cargo check -p craft-update with --no-default-features and --features egui,local-mirror, all --all-targets: passes.
  • cargo test -p craft-video --features mpeg4-encode --test mpeg4_encode: 10 passed.
  • Without dep:craft-image-codecs in tree, cargo check -p craft-svg --features tree fails with E0433 on craft_image_codecs; without dep:thiserror in av1-decode, cargo check -p craft-video --no-default-features --features av1-decode fails with E0433 on thiserror.

craft-update's cfg(target_os = "windows") code was not compiled here; it has no getrandom use, and update.yml builds it on Windows in this pull request's CI.

Pre-existing on main at 6c894be8, with or without this change: craft-svg's tree::tests::every_limit_refuses_the_file_past_it fails at crates/svg/src/tree/tests.rs:84.

Cargo 1.100 reports `unused dependency` for four entries under
`cargo clippy --workspace` (the `unused_dependencies` lint,
https://doc.rust-lang.org/cargo/reference/lints.html), and a fifth,
craft-video's `thiserror`, once those are cleared.

- craft-svg: `craft-image-codecs` is used only by the `tree` module, so
  it is optional and the `tree` feature turns it on.
- craft-update: `getrandom` is removed; no source, test or target-specific
  code uses it, and it set no features.
- craft-video: `craft-media` and `thiserror` are used only by the codec
  modules, so both are optional. Each codec feature turns on what its
  module uses: `dnx` adds `dep:craft-media`, and every feature whose
  module derives `thiserror::Error` adds `dep:thiserror`. The AVI
  dev-dependency stays for the MPEG-4 Part 2 end-to-end test.

The codec, SVG and update features build as before.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6c894be and 0b75584.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 3

  • crates/svg/Cargo.toml
  • crates/update/Cargo.toml
  • crates/video/Cargo.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant