You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks paths in include_str and include_bytes and make sure those paths are found in the include field in Cargo.toml.
Advantage
When using a workspace it is easy to make the mistake of include_bytes!("../../other_crate/data/file.png"). The code will run, but cargo publish will fail, as the referenced file is not part of the crate.
This is true for any file not found in the include field of the crate's Cargo.toml.
Drawbacks
This is only relevant for crates that are intended to be published, i.e. has publish = true in their Cargo.toml.
Example
include_bytes!("../../other_crate/data/file.png")
Clippy warning: The file "../../other_crate/data/file.png" is outside the this crate, so cargo publish will fail.
The text was updated successfully, but these errors were encountered:
What it does
Checks paths in
include_str
andinclude_bytes
and make sure those paths are found in theinclude
field inCargo.toml
.Advantage
When using a workspace it is easy to make the mistake of
include_bytes!("../../other_crate/data/file.png")
. The code will run, butcargo publish
will fail, as the referenced file is not part of the crate.This is true for any file not found in the
include
field of the crate'sCargo.toml
.Drawbacks
This is only relevant for crates that are intended to be published, i.e. has
publish = true
in theirCargo.toml
.Example
Clippy warning: The file "../../other_crate/data/file.png" is outside the this crate, so
cargo publish
will fail.The text was updated successfully, but these errors were encountered: