|
1 | 1 | //! Package-level configuration, feature combination generation, and error types. |
2 | 2 |
|
3 | | -use crate::METADATA_KEY; |
4 | 3 | use crate::config::Config; |
| 4 | +use crate::{METADATA_KEY, PKG_METADATA_SECTION}; |
5 | 5 | use color_eyre::eyre; |
6 | 6 | use itertools::Itertools; |
7 | 7 | use std::collections::{BTreeMap, BTreeSet, HashSet}; |
@@ -37,13 +37,10 @@ impl fmt::Display for FeatureCombinationError { |
37 | 37 | } => { |
38 | 38 | write!( |
39 | 39 | f, |
40 | | - "too many configurations for package `{}`: {} feature(s) would produce {} combinations (limit: {})", |
41 | | - package, |
42 | | - num_features, |
| 40 | + "too many configurations for package `{package}`: {num_features} feature(s) would produce {} combinations (limit: {limit})", |
43 | 41 | num_configurations |
44 | 42 | .map(|v| v.to_string()) |
45 | 43 | .unwrap_or_else(|| "an unbounded number of".to_string()), |
46 | | - limit |
47 | 44 | ) |
48 | 45 | } |
49 | 46 | } |
@@ -93,21 +90,21 @@ impl Package for cargo_metadata::Package { |
93 | 90 |
|
94 | 91 | if !config.deprecated.skip_feature_sets.is_empty() { |
95 | 92 | eprintln!( |
96 | | - "warning: [package.metadata.cargo-feature-combinations].skip_feature_sets in package `{}` is deprecated; use exclude_feature_sets instead", |
| 93 | + "warning: {PKG_METADATA_SECTION}.skip_feature_sets in package `{}` is deprecated; use exclude_feature_sets instead", |
97 | 94 | self.name, |
98 | 95 | ); |
99 | 96 | } |
100 | 97 |
|
101 | 98 | if !config.deprecated.denylist.is_empty() { |
102 | 99 | eprintln!( |
103 | | - "warning: [package.metadata.cargo-feature-combinations].denylist in package `{}` is deprecated; use exclude_features instead", |
| 100 | + "warning: {PKG_METADATA_SECTION}.denylist in package `{}` is deprecated; use exclude_features instead", |
104 | 101 | self.name, |
105 | 102 | ); |
106 | 103 | } |
107 | 104 |
|
108 | 105 | if !config.deprecated.exact_combinations.is_empty() { |
109 | 106 | eprintln!( |
110 | | - "warning: [package.metadata.cargo-feature-combinations].exact_combinations in package `{}` is deprecated; use include_feature_sets instead", |
| 107 | + "warning: {PKG_METADATA_SECTION}.exact_combinations in package `{}` is deprecated; use include_feature_sets instead", |
111 | 108 | self.name, |
112 | 109 | ); |
113 | 110 | } |
|
0 commit comments