rust - How to define test-only dependencies? -
i have rust library implements lint plugin. want include compiletest, not require outside of testing. correct way specify dependency testing only?
yes. use dev-dependencies. cargo docs:
you can add
[dev-dependencies]sectioncargo.tomlformat equivalent[dependencies]:[dev-dependencies] tempdir = "0.3"dev-dependencies not used when compiling package building, used compiling tests, examples, , benchmarks.
Comments
Post a Comment