Skip to content

Commit f520d6c

Browse files
committed
refactor(toml): Be consistent for duplicate field names
1 parent cbd466b commit f520d6c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/cargo/util/toml/schema.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,9 @@ pub struct TomlTarget {
956956
pub doc: Option<bool>,
957957
pub plugin: Option<bool>,
958958
pub doc_scrape_examples: Option<bool>,
959-
#[serde(rename = "proc-macro")]
960-
pub proc_macro_raw: Option<bool>,
959+
pub proc_macro: Option<bool>,
961960
#[serde(rename = "proc_macro")]
962-
pub proc_macro_raw2: Option<bool>,
961+
pub proc_macro2: Option<bool>,
963962
pub harness: Option<bool>,
964963
pub required_features: Option<Vec<String>>,
965964
pub edition: Option<String>,
@@ -971,7 +970,7 @@ impl TomlTarget {
971970
}
972971

973972
pub fn proc_macro(&self) -> Option<bool> {
974-
self.proc_macro_raw.or(self.proc_macro_raw2).or_else(|| {
973+
self.proc_macro.or(self.proc_macro2).or_else(|| {
975974
if let Some(types) = self.crate_types() {
976975
if types.contains(&"proc-macro".to_string()) {
977976
return Some(true);

src/cargo/util/toml/targets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ fn name_or_panic(target: &TomlTarget) -> &str {
10041004
}
10051005

10061006
fn validate_proc_macro(target: &TomlTarget, kind: &str, warnings: &mut Vec<String>) {
1007-
if target.proc_macro_raw.is_some() && target.proc_macro_raw2.is_some() {
1007+
if target.proc_macro.is_some() && target.proc_macro2.is_some() {
10081008
warn_on_deprecated(
10091009
"proc-macro",
10101010
name_or_panic(target),

0 commit comments

Comments
 (0)